Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/newfs_msdos Allow 0 timestamp



details:   https://anonhg.NetBSD.org/src/rev/da16c58d1344
branches:  trunk
changeset: 821766:da16c58d1344
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Feb 16 22:42:25 2017 +0000

description:
Allow 0 timestamp

diffstat:

 sbin/newfs_msdos/mkfs_msdos.c  |  6 +++---
 sbin/newfs_msdos/mkfs_msdos.h  |  3 ++-
 sbin/newfs_msdos/newfs_msdos.c |  5 +++--
 3 files changed, 8 insertions(+), 6 deletions(-)

diffs (70 lines):

diff -r ec34b798e889 -r da16c58d1344 sbin/newfs_msdos/mkfs_msdos.c
--- a/sbin/newfs_msdos/mkfs_msdos.c     Thu Feb 16 22:40:19 2017 +0000
+++ b/sbin/newfs_msdos/mkfs_msdos.c     Thu Feb 16 22:42:25 2017 +0000
@@ -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 @@
        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);
diff -r ec34b798e889 -r da16c58d1344 sbin/newfs_msdos/mkfs_msdos.h
--- a/sbin/newfs_msdos/mkfs_msdos.h     Thu Feb 16 22:40:19 2017 +0000
+++ b/sbin/newfs_msdos/mkfs_msdos.h     Thu Feb 16 22:42:25 2017 +0000
@@ -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 @@
 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;
diff -r ec34b798e889 -r da16c58d1344 sbin/newfs_msdos/newfs_msdos.c
--- a/sbin/newfs_msdos/newfs_msdos.c    Thu Feb 16 22:40:19 2017 +0000
+++ b/sbin/newfs_msdos/newfs_msdos.c    Thu Feb 16 22:42:25 2017 +0000
@@ -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 @@
            o.size = argto4(optarg, 1, "file system size");
            break;
        case 'T':
+           o.timestamp_set = 1;
            o.timestamp = get_tstamp(optarg);
            break;
        case 'u':



Home | Main Index | Thread Index | Old Index