makefs: sync -T timestamp with NetBSD

NetBSD revision:
makefs.c	1.51

Obtained from:	NetBSD
This commit is contained in:
Ed Maste 2017-03-14 18:08:32 +00:00
parent 6327b0d287
commit f490b9b3bf

View File

@ -112,10 +112,13 @@ main(int argc, char *argv[])
fstype->prepare_options(&fsoptions);
specfile = NULL;
#ifdef CLOCK_REALTIME
ch = clock_gettime(CLOCK_REALTIME, &start_time);
#else
ch = gettimeofday(&start, NULL);
start_time.tv_sec = start.tv_sec;
start_time.tv_nsec = start.tv_usec * 1000;
#endif
if (ch == -1)
err(1, "Unable to get system time");