From fbc7088a82f47d7aedd76dc34108b8ca68f0a05e Mon Sep 17 00:00:00 2001 From: emaste Date: Tue, 14 Mar 2017 18:08:32 +0000 Subject: [PATCH] makefs: sync -T timestamp with NetBSD NetBSD revision: makefs.c 1.51 Obtained from: NetBSD --- usr.sbin/makefs/makefs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.sbin/makefs/makefs.c b/usr.sbin/makefs/makefs.c index b3ae7e0136e0..10c7472c13db 100644 --- a/usr.sbin/makefs/makefs.c +++ b/usr.sbin/makefs/makefs.c @@ -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");