From 17b269b03d758b3946451e2724708d72a8882ed4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 23 Nov 2008 18:41:01 +0100 Subject: [PATCH] Applying Fedoras dosfstools-vfat-timingfix.diff from Bill Nottingham to fix vfat timing issue. See https://bugzilla.redhat.com/show_bug.cgi?id=448247 for more information. Signed-off-by: Daniel Baumann --- src/mkdosfs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mkdosfs.c b/src/mkdosfs.c index a5cd3bb..1264efd 100644 --- a/src/mkdosfs.c +++ b/src/mkdosfs.c @@ -57,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -283,6 +284,7 @@ static int check = FALSE; /* Default to no readablity checking */ static int verbose = 0; /* Default to verbose mode off */ static long volume_id; /* Volume ID number */ static time_t create_time; /* Creation time */ +static struct timeval create_timeval; /* Creation time */ static char volume_name[] = " "; /* Volume name */ static unsigned long long blocks; /* Number of blocks in filesystem */ static int sector_size = 512; /* Size of a logical sector */ @@ -1427,8 +1429,9 @@ main (int argc, char **argv) program_name = p+1; } - time(&create_time); - volume_id = (long)create_time; /* Default volume ID = creation time */ + gettimeofday(&create_timeval, NULL); + create_time = create_timeval.tv_sec; + volume_id = (u_int32_t)( (create_timeval.tv_sec << 20) | create_timeval.tv_usec ); /* Default volume ID = creation time, fudged for more uniqueness */ check_atari(); printf ("%s " VERSION " (" VERSION_DATE ")\n",