summaryrefslogtreecommitdiff
path: root/lib/ext2fs/res_gdt.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2005-09-24 20:14:51 -0400
committerTheodore Ts'o <tytso@mit.edu>2005-09-24 20:14:51 -0400
commit32138187f08d1f1dc03feb269f987982db76f3db (patch)
tree311bb28e00cf06424f2983464400661c920dd466 /lib/ext2fs/res_gdt.c
parent6a7075df301f36587fd99d900d1799710e82262f (diff)
downloade2fsprogs-32138187f08d1f1dc03feb269f987982db76f3db.tar.gz
Add fs->now to override time(0) in libext2fs
If fs->now is non-zero, use that as the time instead of the system time when setting various filesystem fields (last modified time, last write time, etc.) Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'lib/ext2fs/res_gdt.c')
-rw-r--r--lib/ext2fs/res_gdt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ext2fs/res_gdt.c b/lib/ext2fs/res_gdt.c
index 8b4ddca6..c03f1da0 100644
--- a/lib/ext2fs/res_gdt.c
+++ b/lib/ext2fs/res_gdt.c
@@ -116,7 +116,7 @@ errcode_t ext2fs_create_resize_inode(ext2_filsys fs)
sb->s_feature_ro_compat |=
EXT2_FEATURE_RO_COMPAT_LARGE_FILE;
}
- inode.i_ctime = time(0);
+ inode.i_ctime = fs->now ? fs->now : time(0);
}
for (rsv_off = 0, gdt_off = fs->desc_blocks,
@@ -208,7 +208,7 @@ out_inode:
inode.i_size);
#endif
if (inode_dirty) {
- inode.i_atime = inode.i_mtime = time(0);
+ inode.i_atime = inode.i_mtime = fs->now ? fs->now : time(0);
retval2 = ext2fs_write_inode(fs, EXT2_RESIZE_INO, &inode);
if (!retval)
retval = retval2;