summaryrefslogtreecommitdiff
path: root/lib/settime.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/settime.c')
-rw-r--r--lib/settime.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/settime.c b/lib/settime.c
index 376d85476a..2ce7c03300 100644
--- a/lib/settime.c
+++ b/lib/settime.c
@@ -41,10 +41,8 @@ settime (struct timespec const *ts)
#if HAVE_SETTIMEOFDAY
{
- struct timeval tv;
-
- tv.tv_sec = ts->tv_sec;
- tv.tv_usec = ts->tv_nsec / 1000;
+ struct timeval tv = { .tv_sec = ts->tv_sec,
+ .tv_usec = ts->tv_nsec / 1000 };
return settimeofday (&tv, 0);
}
#elif HAVE_STIME