summaryrefslogtreecommitdiffstats
path: root/misc/e2image.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-21 04:59:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-21 04:59:33 +0000
commit857a92991db30f538ea8858a2dfda0fe606353e3 (patch)
treedcf97aa3a41925c05670bb640cdd495fc1083f72 /misc/e2image.c
parentAdding debian version 1.47.0-2.4. (diff)
downloade2fsprogs-857a92991db30f538ea8858a2dfda0fe606353e3.tar.xz
e2fsprogs-857a92991db30f538ea8858a2dfda0fe606353e3.zip
Merging upstream version 1.47.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--misc/e2image.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/misc/e2image.c b/misc/e2image.c
index 1ae0300..a926724 100644
--- a/misc/e2image.c
+++ b/misc/e2image.c
@@ -239,6 +239,7 @@ static void write_image_file(ext2_filsys fs, int fd)
struct ext2_image_hdr hdr;
struct stat st;
errcode_t retval;
+ time_t now = time(0);
write_header(fd, NULL, sizeof(struct ext2_image_hdr), fs->blocksize);
memset(&hdr, 0, sizeof(struct ext2_image_hdr));
@@ -292,7 +293,12 @@ static void write_image_file(ext2_filsys fs, int fd)
}
memcpy(hdr.fs_uuid, fs->super->s_uuid, sizeof(hdr.fs_uuid));
- hdr.image_time = ext2fs_cpu_to_le32(time(0));
+ hdr.image_time_lo = ext2fs_cpu_to_le32(now & 0xFFFFFFFF);
+#if (SIZEOF_TIME_T > 4)
+ hdr.image_time_hi = ext2fs_cpu_to_le32(now >> 32);
+#else
+ hdr.image_time_hi = 0;
+#endif
write_header(fd, &hdr, sizeof(struct ext2_image_hdr), fs->blocksize);
}