diff options
author | Zack Weinberg <zackw@panix.com> | 2019-08-16 21:10:11 -0400 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2019-08-21 08:26:36 -0400 |
commit | 1baae4aa6f3313da77d799f12f963910b05db637 (patch) | |
tree | 8e355e8254a1e5f93b381f552ab5e95a3dd64fcf /sysdeps/mach | |
parent | f9fabc1b02d252d5d9b2e0df406bb394b8a7b46a (diff) | |
download | glibc-1baae4aa6f3313da77d799f12f963910b05db637.tar.gz glibc-1baae4aa6f3313da77d799f12f963910b05db637.tar.xz glibc-1baae4aa6f3313da77d799f12f963910b05db637.zip |
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.
Diffstat (limited to 'sysdeps/mach')
-rw-r--r-- | sysdeps/mach/sleep.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/mach/sleep.c b/sysdeps/mach/sleep.c index 11e1bb87f3..c63ef926b7 100644 --- a/sysdeps/mach/sleep.c +++ b/sysdeps/mach/sleep.c @@ -33,10 +33,10 @@ __sleep (unsigned int seconds) recv = __mach_reply_port (); - before = time ((time_t *) NULL); + before = time (NULL); (void) __mach_msg (NULL, MACH_RCV_MSG|MACH_RCV_TIMEOUT|MACH_RCV_INTERRUPT, 0, 0, recv, seconds * 1000, MACH_PORT_NULL); - after = time ((time_t *) NULL); + after = time (NULL); __mach_port_destroy (__mach_task_self (), recv); return seconds - (after - before); |