aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/mkimg/uuid.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/mkimg/uuid.c')
-rw-r--r--usr.bin/mkimg/uuid.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/usr.bin/mkimg/uuid.c b/usr.bin/mkimg/uuid.c
index 470d92c76293..f3415a8c1111 100644
--- a/usr.bin/mkimg/uuid.c
+++ b/usr.bin/mkimg/uuid.c
@@ -45,20 +45,9 @@ osdep_uuidgen(mkimg_uuid_t *uuid)
}
#endif /* __APPLE__ */
-#ifdef __FreeBSD__
-#include <sys/uuid.h>
-
-static void
-osdep_uuidgen(mkimg_uuid_t *uuid)
-{
-
- uuidgen((void *)uuid, 1);
-}
-#endif /* __FreeBSD__ */
-
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD__)
+#include <sys/time.h>
#include <stdlib.h>
-#include <time.h>
static void
osdep_uuidgen(mkimg_uuid_t *uuid)
@@ -68,7 +57,9 @@ osdep_uuidgen(mkimg_uuid_t *uuid)
u_int i;
uint16_t seq;
- if (gettimeofday(&tv, NULL) == -1)
+ if (reproducible)
+ memset(&tv, 0, sizeof(tv));
+ else if (gettimeofday(&tv, NULL) == -1)
abort();
time += (uint64_t)tv.tv_sec * 10000000LL;