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 volumesetname to comply to UDF 2.01 [2.2....



details:   https://anonhg.NetBSD.org/src/rev/ce14857086d2
branches:  trunk
changeset: 335310:ce14857086d2
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Fri Jan 02 21:01:12 2015 +0000

description:
Fix volumesetname to comply to UDF 2.01 [2.2.2.5]

diffstat:

 sbin/newfs_udf/udf_write.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 4fd970846dbb -r ce14857086d2 sbin/newfs_udf/udf_write.c
--- a/sbin/newfs_udf/udf_write.c        Fri Jan 02 20:42:44 2015 +0000
+++ b/sbin/newfs_udf/udf_write.c        Fri Jan 02 21:01:12 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_write.c,v 1.8 2013/08/25 14:13:47 reinoud Exp $ */
+/* $NetBSD: udf_write.c,v 1.9 2015/01/02 21:01:12 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
@@ -30,7 +30,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: udf_write.c,v 1.8 2013/08/25 14:13:47 reinoud Exp $");
+__RCSID("$NetBSD: udf_write.c,v 1.9 2015/01/02 21:01:12 reinoud Exp $");
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -317,6 +317,7 @@
 int
 udf_proces_names(void)
 {
+       struct timeval time_of_day;
        uint32_t primary_nr;
        uint64_t volset_nr;
 
@@ -335,8 +336,9 @@
                if (mmc_discinfo.disc_flags & MMC_DFLAGS_BARCODEVALID) {
                        volset_nr = mmc_discinfo.disc_barcode;
                } else {
-                       volset_nr  =  (uint32_t) random();
-                       volset_nr |= ((uint64_t) random()) << 32;
+                       (void)gettimeofday(&time_of_day, NULL);
+                       volset_nr  =  (uint64_t) random();
+                       volset_nr |= ((uint64_t) time_of_day.tv_sec) << 32;
                }
                context.volset_name = calloc(128,1);
                sprintf(context.volset_name, "%016"PRIx64, volset_nr);



Home | Main Index | Thread Index | Old Index