This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] settimeofday with NULL tv
- From: Jeff Law <law at redhat dot com>
- To: libc-alpha <libc-alpha at sourceware dot org>
- Date: Mon, 03 Dec 2012 12:04:08 -0700
- Subject: [PATCH] settimeofday with NULL tv
settimeofday (NULL, tz) is used by systemd (and perhaps other code) to
change the kernel timezone. Unfortunately, glibc marks the first
argument as must-be-nonnull. This causes static analyzers to issue
incorrect diagnostics for such uses of settimeofday.
This patch removes the __nonnull attribute and the bogus diagnostics no
longer are issued.
diff --git a/ChangeLog b/ChangeLog
index 638934b..624078b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-12-03 Jeff Law <law@redhat.com>
+
+ * time/sys/time.h (settimeofday): Do not mark TV argument
+ as __nonnull.
+
2012-12-01 Mike Frysinger <vapier@gentoo.org>
* libio/fileops.c (_IO_new_file_close_it): Do not always flush
diff --git a/time/sys/time.h b/time/sys/time.h
index 0f5ef5c..f763d96 100644
--- a/time/sys/time.h
+++ b/time/sys/time.h
@@ -77,7 +77,7 @@ extern int gettimeofday (struct timeval *__restrict __tv,
This call is restricted to the super-user. */
extern int settimeofday (const struct timeval *__tv,
const struct timezone *__tz)
- __THROW __nonnull ((1));
+ __THROW;
/* Adjust the current time of day by the amount in DELTA.
If OLDDELTA is not NULL, it is filled in with the amount