Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148619511
D49531.id152737.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D49531.id152737.diff
View Options
diff --git a/usr.sbin/makefs/mtree.c b/usr.sbin/makefs/mtree.c
--- a/usr.sbin/makefs/mtree.c
+++ b/usr.sbin/makefs/mtree.c
@@ -476,6 +476,7 @@
static int
read_mtree_keywords(FILE *fp, fsnode *node)
{
+ bool have_mtree_time;
char keyword[PATH_MAX];
char *name, *p, *value;
gid_t gid;
@@ -487,6 +488,7 @@
uint32_t type;
st = &node->inode->st;
+ have_mtree_time = false;
do {
error = skip_over(fp, " \t");
if (error)
@@ -658,6 +660,7 @@
st->st_ctimensec = num;
st->st_mtimensec = num;
#endif
+ have_mtree_time = true;
} else if (strcmp(keyword, "type") == 0) {
if (value == NULL) {
error = ENOATTR;
@@ -722,7 +725,17 @@
return (error);
st->st_mode = (st->st_mode & ~S_IFMT) | node->type;
-
+ /* Store -T timestamp only if the mtree entry didn't specify 'time'.*/
+ if (stampst.st_ino != 0 && !have_mtree_time) {
+ st->st_atime = stampst.st_atime;
+ st->st_ctime = stampst.st_ctime;
+ st->st_mtime = stampst.st_mtime;
+#if HAVE_STRUCT_STAT_ST_MTIMENSEC
+ st->st_atimensec = stampst.st_atimensec;
+ st->st_mtimensec = stampst.st_mtimensec;
+ st->st_ctimensec = stampst.st_ctimensec;
+#endif
+ }
/* Nothing more to do for the global defaults. */
if (node->name == NULL)
return (0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 20, 4:38 AM (2 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29998861
Default Alt Text
D49531.id152737.diff (1 KB)
Attached To
Mode
D49531: makefs: Honor -T timestamps when creating images from mtree manifests
Attached
Detach File
Event Timeline
Log In to Comment