diff --git a/usr.sbin/makefs/msdos.c b/usr.sbin/makefs/msdos.c index 150e6c260115..6200d83bb4b6 100644 --- a/usr.sbin/makefs/msdos.c +++ b/usr.sbin/makefs/msdos.c @@ -1,4 +1,4 @@ -/* $NetBSD: msdos.c,v 1.16 2016/01/30 09:59:27 mlelstv Exp $ */ +/* $NetBSD: msdos.c,v 1.17 2017/02/16 18:50:04 christos Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ #include #if defined(__RCSID) && !defined(__lint) -__RCSID("$NetBSD: msdos.c,v 1.16 2016/01/30 09:59:27 mlelstv Exp $"); +__RCSID("$NetBSD: msdos.c,v 1.17 2017/02/16 18:50:04 christos Exp $"); #endif /* !__lint */ #include @@ -133,6 +133,9 @@ msdos_parse_opts(const char *option, fsinfo_t *fsopts) msdos_opt->media_descriptor_set = 1; else if (strcmp(msdos_options[rv].name, "hidden_sectors") == 0) msdos_opt->hidden_sectors_set = 1; + + msdos_opt->timestamp = stampst.st_ino ? stampst.st_mtime : 0; + return 1; } diff --git a/usr.sbin/makefs/msdos/msdosfs_vnops.c b/usr.sbin/makefs/msdos/msdosfs_vnops.c index 8ed4839185d1..a40c66e463f6 100644 --- a/usr.sbin/makefs/msdos/msdosfs_vnops.c +++ b/usr.sbin/makefs/msdos/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfs_vnops.c,v 1.17 2016/01/30 09:59:27 mlelstv Exp $ */ +/* $NetBSD: msdosfs_vnops.c,v 1.18 2017/02/16 18:50:05 christos Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -51,7 +51,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.17 2016/01/30 09:59:27 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.18 2017/02/16 18:50:05 christos Exp $"); #include #include @@ -98,12 +98,20 @@ static void msdosfs_times(struct msdosfsmount *pmp, struct denode *dep, const struct stat *st) { + struct timespec at; + struct timespec mt; + + if (stampst.st_ino) + st = &stampst; + #ifndef HAVE_NBTOOL_CONFIG_H - struct timespec at = st->st_atimespec; - struct timespec mt = st->st_mtimespec; + at = st->st_atimespec; + mt = st->st_mtimespec; #else - struct timespec at = { st->st_atime, 0 }; - struct timespec mt = { st->st_mtime, 0 }; + at.tv_sec = st->st_atime; + at.tv_nsec = 0; + mt.tv_sec = st->st_mtime; + mt.tv_nsec = 0; #endif unix2dostime(&at, pmp->pm_gmtoff, &dep->de_ADate, NULL, NULL); unix2dostime(&mt, pmp->pm_gmtoff, &dep->de_MDate, &dep->de_MTime, NULL);