diff options
author | Karel Zak | 2019-01-14 12:04:04 +0100 |
---|---|---|
committer | Karel Zak | 2019-01-14 12:04:04 +0100 |
commit | 491f3693cbe71fd3cef3f63bb0a286ee85422456 (patch) | |
tree | ed929e688197ac51bd4b10269307b6171e1539eb /disk-utils | |
parent | Merge branch 'asan-fixes' of https://github.com/kerolasa/util-linux (diff) | |
parent | fsck.cramfs: use utimes() instead of utime() that is obsolete (diff) | |
download | kernel-qcow2-util-linux-491f3693cbe71fd3cef3f63bb0a286ee85422456.tar.gz kernel-qcow2-util-linux-491f3693cbe71fd3cef3f63bb0a286ee85422456.tar.xz kernel-qcow2-util-linux-491f3693cbe71fd3cef3f63bb0a286ee85422456.zip |
Merge branch 'time-fixes' of https://github.com/kerolasa/util-linux
* 'time-fixes' of https://github.com/kerolasa/util-linux:
fsck.cramfs: use utimes() instead of utime() that is obsolete
hwclock: use monotonic time to measure how long setting time takes
include: add indirect monotonic clock id specifier
timeutils: match today day and this year correctly
Diffstat (limited to 'disk-utils')
-rw-r--r-- | disk-utils/fsck.cramfs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/disk-utils/fsck.cramfs.c b/disk-utils/fsck.cramfs.c index 0d9bdadf7..76ed303b0 100644 --- a/disk-utils/fsck.cramfs.c +++ b/disk-utils/fsck.cramfs.c @@ -42,7 +42,6 @@ #include <errno.h> #include <string.h> #include <getopt.h> -#include <utime.h> #include <fcntl.h> /* We don't use our include/crc32.h, but crc32 from zlib! @@ -52,6 +51,7 @@ */ #include <zlib.h> +#include <sys/time.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/mman.h> @@ -419,7 +419,7 @@ static void do_uncompress(char *path, int outfd, unsigned long offset, static void change_file_status(char *path, struct cramfs_inode *i) { - struct utimbuf epoch = { 0, 0 }; + const struct timeval epoch = { 0, 0 }; if (euid == 0) { if (lchown(path, i->uid, i->gid) < 0) @@ -431,8 +431,8 @@ static void change_file_status(char *path, struct cramfs_inode *i) } if (S_ISLNK(i->mode)) return; - if (utime(path, &epoch) < 0) - err(FSCK_EX_ERROR, _("utime failed: %s"), path); + if (utimes(path, &epoch) < 0) + err(FSCK_EX_ERROR, _("utimes failed: %s"), path); } static void do_directory(char *path, struct cramfs_inode *i) |