diff -Paur --no-dereference -- dosfstools.upstream/src/blkdev/blkdev.c dosfstools/src/blkdev/blkdev.c
--- dosfstools.upstream/src/blkdev/blkdev.c
+++ dosfstools/src/blkdev/blkdev.c
@@ -7,7 +7,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
-#include <sys/sysmacros.h>
 #include <unistd.h>
 #include <stdint.h>
 #include <stdio.h>
diff -Paur --no-dereference -- dosfstools.upstream/src/common.c dosfstools/src/common.c
--- dosfstools.upstream/src/common.c
+++ dosfstools/src/common.c
@@ -297,16 +297,7 @@
 
 uint32_t generate_volume_id(void)
 {
-    struct timeval now;
-
-    if (gettimeofday(&now, NULL) != 0 || now.tv_sec == (time_t)-1 || now.tv_sec < 0) {
-        srand(getpid());
-        /* rand() returns int from [0,RAND_MAX], therefore only 31 bits */
-        return (((uint32_t)(rand() & 0xFFFF)) << 16) | ((uint32_t)(rand() & 0xFFFF));
-    }
-
-    /* volume ID = current time, fudged for more uniqueness */
-    return ((uint32_t)now.tv_sec << 20) | (uint32_t)now.tv_usec;
+	return arc4random();
 }
 
 /*
diff -Paur --no-dereference -- dosfstools.upstream/src/device_info.c dosfstools/src/device_info.c
--- dosfstools.upstream/src/device_info.c
+++ dosfstools/src/device_info.c
@@ -24,7 +24,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
-#include <sys/sysmacros.h>
 
 #ifdef HAVE_LINUX_LOOP_H
 #include <linux/loop.h>
