Allow 0 timestamp
This commit is contained in:
parent
f8bc8f05cf
commit
285cf56905
|
@ -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
|
* Copyright (c) 1998 Robert Nordier
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
static const char rcsid[] =
|
static const char rcsid[] =
|
||||||
"$FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $";
|
"$FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $";
|
||||||
#else
|
#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
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
|
@ -621,7 +621,7 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
||||||
printf("MBR type: %d\n", ch);
|
printf("MBR type: %d\n", ch);
|
||||||
print_bpb(&bpb);
|
print_bpb(&bpb);
|
||||||
if (!o.no_create) {
|
if (!o.no_create) {
|
||||||
if (o.timestamp) {
|
if (o.timestamp_set) {
|
||||||
tv.tv_sec = now = o.timestamp;
|
tv.tv_sec = now = o.timestamp;
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
tm = gmtime(&now);
|
tm = gmtime(&now);
|
||||||
|
|
|
@ -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.
|
* Copyright (c) 2013 The NetBSD Foundation, Inc.
|
||||||
|
@ -61,6 +61,7 @@ struct msdos_options {
|
||||||
ALLOPTS
|
ALLOPTS
|
||||||
#undef AOPT
|
#undef AOPT
|
||||||
time_t timestamp;
|
time_t timestamp;
|
||||||
|
uint32_t timestamp_set:1;
|
||||||
uint32_t volume_id_set:1;
|
uint32_t volume_id_set:1;
|
||||||
uint32_t media_descriptor_set:1;
|
uint32_t media_descriptor_set:1;
|
||||||
uint32_t hidden_sectors_set:1;
|
uint32_t hidden_sectors_set:1;
|
||||||
|
|
|
@ -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
|
* Copyright (c) 1998 Robert Nordier
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
static const char rcsid[] =
|
static const char rcsid[] =
|
||||||
"$FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $";
|
"$FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $";
|
||||||
#else
|
#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
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
|
@ -170,6 +170,7 @@ main(int argc, char *argv[])
|
||||||
o.size = argto4(optarg, 1, "file system size");
|
o.size = argto4(optarg, 1, "file system size");
|
||||||
break;
|
break;
|
||||||
case 'T':
|
case 'T':
|
||||||
|
o.timestamp_set = 1;
|
||||||
o.timestamp = get_tstamp(optarg);
|
o.timestamp = get_tstamp(optarg);
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
|
|
Loading…
Reference in New Issue