From 12d12102d6e79c3627dbf0569f1c97b00202ce4c Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 15 Jan 2019 11:44:25 +0100 Subject: fsck.cramfs: fix utimes() usage The bug has been introduced by untested commit ad7ac3d598e2d541d9eba70975e68dff7e52c7d9 ;-( Signed-off-by: Karel Zak --- disk-utils/fsck.cramfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'disk-utils') diff --git a/disk-utils/fsck.cramfs.c b/disk-utils/fsck.cramfs.c index 76ed303b0..ee9c20ab2 100644 --- a/disk-utils/fsck.cramfs.c +++ b/disk-utils/fsck.cramfs.c @@ -416,10 +416,10 @@ static void do_uncompress(char *path, int outfd, unsigned long offset, curr = next; } while (size); } - +#include static void change_file_status(char *path, struct cramfs_inode *i) { - const struct timeval epoch = { 0, 0 }; + const struct timeval epoch[] = { {0,0}, {0,0} }; if (euid == 0) { if (lchown(path, i->uid, i->gid) < 0) @@ -431,7 +431,7 @@ static void change_file_status(char *path, struct cramfs_inode *i) } if (S_ISLNK(i->mode)) return; - if (utimes(path, &epoch) < 0) + if (utimes(path, epoch) < 0) err(FSCK_EX_ERROR, _("utimes failed: %s"), path); } -- cgit v1.2.3-55-g7522