diff options
Diffstat (limited to 'lib/ext2fs/mkjournal.c')
-rw-r--r-- | lib/ext2fs/mkjournal.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/ext2fs/mkjournal.c b/lib/ext2fs/mkjournal.c index 54772dd..27cdfa0 100644 --- a/lib/ext2fs/mkjournal.c +++ b/lib/ext2fs/mkjournal.c @@ -20,7 +20,6 @@ #include <errno.h> #endif #include <fcntl.h> -#include <time.h> #if HAVE_SYS_STAT_H #include <sys/stat.h> #endif @@ -36,7 +35,7 @@ #include "ext2_fs.h" #include "e2p/e2p.h" -#include "ext2fs.h" +#include "ext2fsP.h" #include "kernel-jbd.h" @@ -285,6 +284,7 @@ static errcode_t write_journal_inode(ext2_filsys fs, ext2_ino_t journal_ino, unsigned long long inode_size; int falloc_flags = EXT2_FALLOCATE_FORCE_INIT; blk64_t zblk; + time_t now; if ((retval = ext2fs_create_journal_superblock2(fs, jparams, flags, &buf))) @@ -312,7 +312,9 @@ static errcode_t write_journal_inode(ext2_filsys fs, ext2_ino_t journal_ino, inode_size = (unsigned long long)fs->blocksize * (jparams->num_journal_blocks + jparams->num_fc_blocks); - inode.i_mtime = inode.i_ctime = fs->now ? fs->now : time(0); + now = ext2fsP_get_time(fs); + ext2fs_inode_xtime_set(&inode, i_mtime, now); + ext2fs_inode_xtime_set(&inode, i_ctime, now); inode.i_links_count = 1; inode.i_mode = LINUX_S_IFREG | 0600; retval = ext2fs_inode_size_set(fs, &inode, inode_size); |