Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/makefs Add timestamp support to the ffs image creat...
details: https://anonhg.NetBSD.org/src/rev/7632317b6e69
branches: trunk
changeset: 342410:7632317b6e69
user: christos <christos%NetBSD.org@localhost>
date: Sun Dec 20 22:54:44 2015 +0000
description:
Add timestamp support to the ffs image creation; needed for in kernel memory
images MKREPRO.
diffstat:
usr.sbin/makefs/ffs.c | 48 ++++++++++++++++++++++++++----------------------
1 files changed, 26 insertions(+), 22 deletions(-)
diffs (101 lines):
diff -r 2c945935e2c9 -r 7632317b6e69 usr.sbin/makefs/ffs.c
--- a/usr.sbin/makefs/ffs.c Sun Dec 20 22:47:59 2015 +0000
+++ b/usr.sbin/makefs/ffs.c Sun Dec 20 22:54:44 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs.c,v 1.64 2015/01/12 19:50:25 christos Exp $ */
+/* $NetBSD: ffs.c,v 1.65 2015/12/20 22:54:44 christos Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -71,7 +71,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: ffs.c,v 1.64 2015/01/12 19:50:25 christos Exp $");
+__RCSID("$NetBSD: ffs.c,v 1.65 2015/12/20 22:54:44 christos Exp $");
#endif /* !__lint */
#include <sys/param.h>
@@ -637,19 +637,12 @@
{
size_t slen;
void *membuf;
+ struct stat *st = stampst.st_ino == 1 ? &stampst : &cur->inode->st;
memset(dinp, 0, sizeof(*dinp));
dinp->di_mode = cur->inode->st.st_mode;
dinp->di_nlink = cur->inode->nlink;
dinp->di_size = cur->inode->st.st_size;
- dinp->di_atime = cur->inode->st.st_atime;
- dinp->di_mtime = cur->inode->st.st_mtime;
- dinp->di_ctime = cur->inode->st.st_ctime;
-#if HAVE_STRUCT_STAT_ST_MTIMENSEC
- dinp->di_atimensec = cur->inode->st.st_atimensec;
- dinp->di_mtimensec = cur->inode->st.st_mtimensec;
- dinp->di_ctimensec = cur->inode->st.st_ctimensec;
-#endif
#if HAVE_STRUCT_STAT_ST_FLAGS
dinp->di_flags = cur->inode->st.st_flags;
#endif
@@ -658,6 +651,15 @@
#endif
dinp->di_uid = cur->inode->st.st_uid;
dinp->di_gid = cur->inode->st.st_gid;
+
+ dinp->di_atime = st->st_atime;
+ dinp->di_mtime = st->st_mtime;
+ dinp->di_ctime = st->st_ctime;
+#if HAVE_STRUCT_STAT_ST_MTIMENSEC
+ dinp->di_atimensec = st->st_atimensec;
+ dinp->di_mtimensec = st->st_mtimensec;
+ dinp->di_ctimensec = st->st_ctimensec;
+#endif
/* not set: di_db, di_ib, di_blocks, di_spare */
membuf = NULL;
@@ -685,31 +687,33 @@
{
size_t slen;
void *membuf;
+ struct stat *st = stampst.st_ino == 1 ? &stampst : &cur->inode->st;
memset(dinp, 0, sizeof(*dinp));
dinp->di_mode = cur->inode->st.st_mode;
dinp->di_nlink = cur->inode->nlink;
dinp->di_size = cur->inode->st.st_size;
- dinp->di_atime = cur->inode->st.st_atime;
- dinp->di_mtime = cur->inode->st.st_mtime;
- dinp->di_ctime = cur->inode->st.st_ctime;
-#if HAVE_STRUCT_STAT_ST_MTIMENSEC
- dinp->di_atimensec = cur->inode->st.st_atimensec;
- dinp->di_mtimensec = cur->inode->st.st_mtimensec;
- dinp->di_ctimensec = cur->inode->st.st_ctimensec;
-#endif
#if HAVE_STRUCT_STAT_ST_FLAGS
dinp->di_flags = cur->inode->st.st_flags;
#endif
#if HAVE_STRUCT_STAT_ST_GEN
dinp->di_gen = cur->inode->st.st_gen;
#endif
-#if HAVE_STRUCT_STAT_BIRTHTIME
- dinp->di_birthtime = cur->inode->st.st_birthtime;
- dinp->di_birthnsec = cur->inode->st.st_birthtimensec;
-#endif
dinp->di_uid = cur->inode->st.st_uid;
dinp->di_gid = cur->inode->st.st_gid;
+
+ dinp->di_atime = st->st_atime;
+ dinp->di_mtime = st->st_mtime;
+ dinp->di_ctime = st->st_ctime;
+#if HAVE_STRUCT_STAT_ST_MTIMENSEC
+ dinp->di_atimensec = st->st_atimensec;
+ dinp->di_mtimensec = st->st_mtimensec;
+ dinp->di_ctimensec = st->st_ctimensec;
+#endif
+#if HAVE_STRUCT_STAT_BIRTHTIME
+ dinp->di_birthtime = st->st_birthtime;
+ dinp->di_birthnsec = st->st_birthtimensec;
+#endif
/* not set: di_db, di_ib, di_blocks, di_spare */
membuf = NULL;
Home |
Main Index |
Thread Index |
Old Index