Module Name:    src
Committed By:   christos
Date:           Thu Feb 16 22:42:25 UTC 2017

Modified Files:
        src/sbin/newfs_msdos: mkfs_msdos.c mkfs_msdos.h newfs_msdos.c

Log Message:
Allow 0 timestamp


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sbin/newfs_msdos/mkfs_msdos.c
cvs rdiff -u -r1.4 -r1.5 src/sbin/newfs_msdos/mkfs_msdos.h
cvs rdiff -u -r1.44 -r1.45 src/sbin/newfs_msdos/newfs_msdos.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/newfs_msdos/mkfs_msdos.c
diff -u src/sbin/newfs_msdos/mkfs_msdos.c:1.11 src/sbin/newfs_msdos/mkfs_msdos.c:1.12
--- src/sbin/newfs_msdos/mkfs_msdos.c:1.11	Thu Feb 16 13:49:31 2017
+++ src/sbin/newfs_msdos/mkfs_msdos.c	Thu Feb 16 17:42:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkfs_msdos.c,v 1.11 2017/02/16 18:49:31 christos Exp $	*/
+/*	$NetBSD: mkfs_msdos.c,v 1.12 2017/02/16 22:42:25 christos Exp $	*/
 
 /*
  * Copyright (c) 1998 Robert Nordier
@@ -37,7 +37,7 @@
 static const char rcsid[] =
   "$FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $";
 #else
-__RCSID("$NetBSD: mkfs_msdos.c,v 1.11 2017/02/16 18:49:31 christos Exp $");
+__RCSID("$NetBSD: mkfs_msdos.c,v 1.12 2017/02/16 22:42:25 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -621,7 +621,7 @@ mkfs_msdos(const char *fname, const char
 	printf("MBR type: %d\n", ch);
     print_bpb(&bpb);
     if (!o.no_create) {
-	if (o.timestamp) {
+	if (o.timestamp_set) {
 		tv.tv_sec = now = o.timestamp;
 		tv.tv_usec = 0;
 		tm = gmtime(&now);

Index: src/sbin/newfs_msdos/mkfs_msdos.h
diff -u src/sbin/newfs_msdos/mkfs_msdos.h:1.4 src/sbin/newfs_msdos/mkfs_msdos.h:1.5
--- src/sbin/newfs_msdos/mkfs_msdos.h:1.4	Thu Feb 16 13:49:31 2017
+++ src/sbin/newfs_msdos/mkfs_msdos.h	Thu Feb 16 17:42:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkfs_msdos.h,v 1.4 2017/02/16 18:49:31 christos Exp $	*/
+/*	$NetBSD: mkfs_msdos.h,v 1.5 2017/02/16 22:42:25 christos Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -61,6 +61,7 @@ struct msdos_options {
 ALLOPTS
 #undef AOPT	
 	time_t	timestamp;
+	uint32_t timestamp_set:1;
 	uint32_t volume_id_set:1;
 	uint32_t media_descriptor_set:1;
 	uint32_t hidden_sectors_set:1;

Index: src/sbin/newfs_msdos/newfs_msdos.c
diff -u src/sbin/newfs_msdos/newfs_msdos.c:1.44 src/sbin/newfs_msdos/newfs_msdos.c:1.45
--- src/sbin/newfs_msdos/newfs_msdos.c:1.44	Thu Feb 16 13:49:31 2017
+++ src/sbin/newfs_msdos/newfs_msdos.c	Thu Feb 16 17:42:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: newfs_msdos.c,v 1.44 2017/02/16 18:49:31 christos Exp $	*/
+/*	$NetBSD: newfs_msdos.c,v 1.45 2017/02/16 22:42:25 christos Exp $	*/
 
 /*
  * Copyright (c) 1998 Robert Nordier
@@ -33,7 +33,7 @@
 static const char rcsid[] =
   "$FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $";
 #else
-__RCSID("$NetBSD: newfs_msdos.c,v 1.44 2017/02/16 18:49:31 christos Exp $");
+__RCSID("$NetBSD: newfs_msdos.c,v 1.45 2017/02/16 22:42:25 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -170,6 +170,7 @@ main(int argc, char *argv[])
 	    o.size = argto4(optarg, 1, "file system size");
 	    break;
 	case 'T':
+	    o.timestamp_set = 1;
 	    o.timestamp = get_tstamp(optarg);
 	    break;
 	case 'u':

Reply via email to