diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-04-27 17:22:55 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-04-27 17:22:55 +0200 |
commit | 0a2f9085e29c855ec1aaa996ded00fc36b06210c (patch) | |
tree | 09bced8dbcbd21c4695a74d8570cd4d4c4f9fc3f /src/update-done | |
parent | d72bc5973465018e077fcecdcc720840bc1e9cfd (diff) |
update-done: minor simplification
Diffstat (limited to 'src/update-done')
-rw-r--r-- | src/update-done/update-done.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/update-done/update-done.c b/src/update-done/update-done.c index 44caf84faf..fb7ff988bb 100644 --- a/src/update-done/update-done.c +++ b/src/update-done/update-done.c @@ -28,7 +28,10 @@ "was updated. See systemd-update-done.service(8).\n" static int apply_timestamp(const char *path, struct timespec *ts) { - struct timespec twice[2]; + struct timespec twice[2] = { + *ts, + *ts + }; struct stat st; assert(path); @@ -41,9 +44,6 @@ static int apply_timestamp(const char *path, struct timespec *ts) { return 0; /* It is older? Then let's update it */ - twice[0] = *ts; - twice[1] = *ts; - if (utimensat(AT_FDCWD, path, twice, AT_SYMLINK_NOFOLLOW) < 0) { if (errno == EROFS) @@ -74,9 +74,6 @@ static int apply_timestamp(const char *path, struct timespec *ts) { (void) loop_write(fd, MESSAGE, strlen(MESSAGE), false); - twice[0] = *ts; - twice[1] = *ts; - if (futimens(fd, twice) < 0) return log_error_errno(errno, "Failed to update timestamp on %s: %m", path); } else |