From 1baae4aa6f3313da77d799f12f963910b05db637 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Fri, 16 Aug 2019 21:10:11 -0400 Subject: Don't use the argument to time. It doesn't make sense to remove all the internal uses of time. It's still a standard ISO C function, and its callers don't need sub-second resolution and would be unnecessarily complicated if they had to declare a struct timespec instead of just a time_t. However, a handful of places were using the vestigial "result" argument instead of the return value, which is slightly less efficient and also looks strange. Correct this. * misc/syslog.c (__vsyslog_internal) * time/getdate.c (__getdate_r) * time/tst_wcsftime.c (main): Use return value of time, not its argument. * string/strfry.c (strfry) * sysdeps/mach/sleep.c (__sleep): Remove unnecessary casts of NULL in calls to time. --- misc/syslog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'misc/syslog.c') diff --git a/misc/syslog.c b/misc/syslog.c index 3a15da41ce..cf2deef533 100644 --- a/misc/syslog.c +++ b/misc/syslog.c @@ -205,7 +205,7 @@ __vsyslog_internal(int pri, const char *fmt, va_list ap, { __fsetlocking (f, FSETLOCKING_BYCALLER); fprintf (f, "<%d>", pri); - (void) time (&now); + now = time (NULL); f->_IO_write_ptr += __strftime_l (f->_IO_write_ptr, f->_IO_write_end - f->_IO_write_ptr, -- cgit 1.4.1