summaryrefslogtreecommitdiffstats
path: root/disk-utils
diff options
context:
space:
mode:
authorKarel Zak2019-01-15 11:44:25 +0100
committerKarel Zak2019-01-15 11:44:25 +0100
commit12d12102d6e79c3627dbf0569f1c97b00202ce4c (patch)
treee64f636cb2e3321a31967960724d68ac522eaecd /disk-utils
parentbuild-sys: use REALTIME_LIBS for hwclock due to monotonic.c (diff)
downloadkernel-qcow2-util-linux-12d12102d6e79c3627dbf0569f1c97b00202ce4c.tar.gz
kernel-qcow2-util-linux-12d12102d6e79c3627dbf0569f1c97b00202ce4c.tar.xz
kernel-qcow2-util-linux-12d12102d6e79c3627dbf0569f1c97b00202ce4c.zip
fsck.cramfs: fix utimes() usage
The bug has been introduced by untested commit ad7ac3d598e2d541d9eba70975e68dff7e52c7d9 ;-( Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils')
-rw-r--r--disk-utils/fsck.cramfs.c6
1 files changed, 3 insertions, 3 deletions
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 <utime.h>
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);
}