Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/newfs_udf Fix tool build under Mac OS X by using gettim...



details:   https://anonhg.NetBSD.org/src/rev/24cb62b4b715
branches:  trunk
changeset: 789188:24cb62b4b715
user:      tron <tron%NetBSD.org@localhost>
date:      Sat Aug 10 23:25:35 2013 +0000

description:
Fix tool build under Mac OS X by using gettimeofday(2) instead of
clock_gettime(2). This needs a proper auto-config check.

diffstat:

 sbin/newfs_udf/udf_create.c |  14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 7a690333fa66 -r 24cb62b4b715 sbin/newfs_udf/udf_create.c
--- a/sbin/newfs_udf/udf_create.c       Sat Aug 10 22:37:06 2013 +0000
+++ b/sbin/newfs_udf/udf_create.c       Sat Aug 10 23:25:35 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_create.c,v 1.22 2013/08/06 13:15:30 reinoud Exp $ */
+/* $NetBSD: udf_create.c,v 1.23 2013/08/10 23:25:35 tron Exp $ */
 
 /*
  * Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -30,7 +30,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: udf_create.c,v 1.22 2013/08/06 13:15:30 reinoud Exp $");
+__RCSID("$NetBSD: udf_create.c,v 1.23 2013/08/10 23:25:35 tron Exp $");
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -646,7 +646,15 @@
 {
        struct timespec now;
 
-       clock_gettime(CLOCK_REALTIME, &now);
+#ifdef CLOCK_REALTIME
+       (void)clock_gettime(CLOCK_REALTIME, &now);
+#else
+       struct timeval time_of_day;
+
+       (void)gettimeofday(&time_of_day, NULL);
+       now.tv_sec = time_of_day.tv_sec;
+       now.tv_nsec = time_of_day.tv_usec * 1000;
+#endif
        udf_timespec_to_timestamp(&now, timestamp);
 }
 



Home | Main Index | Thread Index | Old Index