[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r6504 - in /fsf/trunk/libc: ChangeLog sysdeps/mach/hurd/open.c sysdeps/mach/hurd/openat.c time/mktime.c



Author: eglibc
Date: Mon Jul  7 00:04:36 2008
New Revision: 6504

Log:
Import glibc-mainline for 2008-07-07

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/sysdeps/mach/hurd/open.c
    fsf/trunk/libc/sysdeps/mach/hurd/openat.c
    fsf/trunk/libc/time/mktime.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Mon Jul  7 00:04:36 2008
@@ -1,3 +1,17 @@
+2008-07-06  Samuel Thibault  <samuel.thibault@xxxxxxxxxxxx>
+
+	* sysdeps/mach/hurd/open.c: Include <stdio.h>.
+	(__open_2): New function.
+	(__open64_2): New alias to __open_2.
+	* sysdeps/mach/hurd/openat.c: Include <stdio.h>.
+	(__openat_2): New function.
+	(__openat64_2): New alias to __openat_2.
+
+2008-07-06  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #6723]
+	* time/mktime.c (__mktime_internal): Normalize tp->tm_isdst value.
+
 2008-07-01  Samuel Thibault  <samuel.thibault@xxxxxxxxxxxx>
 
 	* sysdeps/unix/bsd/bsd4.4/bits/socket.h: Define MSG_NOSIGNAL.

Modified: fsf/trunk/libc/sysdeps/mach/hurd/open.c
==============================================================================
--- fsf/trunk/libc/sysdeps/mach/hurd/open.c (original)
+++ fsf/trunk/libc/sysdeps/mach/hurd/open.c Mon Jul  7 00:04:36 2008
@@ -19,6 +19,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <stdarg.h>
+#include <stdio.h>
 #include <hurd.h>
 #include <hurd/fd.h>
 
@@ -52,8 +53,20 @@
 libc_hidden_weak (__open)
 weak_alias (__libc_open, open)
 
+int
+__open_2 (file, oflag)
+     const char *file;
+     int oflag;
+{
+  if (oflag & O_CREAT)
+    __fortify_fail ("invalid open call: O_CREAT without mode");
+
+  return __open (file, oflag);
+}
+
 /* open64 is just the same as open for us.  */
 weak_alias (__libc_open, __libc_open64)
 weak_alias (__libc_open, __open64)
 libc_hidden_weak (_open64)
 weak_alias (__libc_open, open64)
+strong_alias (__open_2, __open64_2)

Modified: fsf/trunk/libc/sysdeps/mach/hurd/openat.c
==============================================================================
--- fsf/trunk/libc/sysdeps/mach/hurd/openat.c (original)
+++ fsf/trunk/libc/sysdeps/mach/hurd/openat.c Mon Jul  7 00:04:36 2008
@@ -21,6 +21,7 @@
 #include <fcntl.h>
 #include <stdarg.h>
 #include <stddef.h>
+#include <stdio.h>
 #include <sys/stat.h>
 #include <hurd.h>
 #include <hurd/fd.h>
@@ -56,7 +57,20 @@
 libc_hidden_def (__openat)
 weak_alias (__openat, openat)
 
+int
+__openat_2 (fd, file, oflag)
+     int fd;
+     const char *file;
+     int oflag;
+{
+  if (oflag & O_CREAT)
+    __fortify_fail ("invalid openat call: O_CREAT without mode");
+
+  return __openat (fd, file, oflag);
+}
+
 /* openat64 is just the same as openat for us.  */
 weak_alias (__openat, __openat64)
 libc_hidden_weak (__openat64)
 weak_alias (__openat, openat64)
+strong_alias (__openat_2, __openat64_2)

Modified: fsf/trunk/libc/time/mktime.c
==============================================================================
--- fsf/trunk/libc/time/mktime.c (original)
+++ fsf/trunk/libc/time/mktime.c Mon Jul  7 00:04:36 2008
@@ -1,5 +1,5 @@
 /* Convert a `struct tm' to a time_t value.
-   Copyright (C) 1993-1999, 2002-2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1993-1999, 2002-2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Paul Eggert <eggert@xxxxxxxxxxx>.
 
@@ -293,7 +293,9 @@
   int mday = tp->tm_mday;
   int mon = tp->tm_mon;
   int year_requested = tp->tm_year;
-  int isdst = tp->tm_isdst;
+  /* Normalize the value.  */
+  int isdst = ((tp->tm_isdst >> (8 * sizeof (tp->tm_isdst) - 1))
+	       | (tp->tm_isdst != 0));
 
   /* 1 if the previous probe was DST.  */
   int dst2;