File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 2828 "was updated. See systemd-update-done.service(8).\n"
2929
3030static int apply_timestamp (const char * path , struct timespec * ts ) {
31- struct timespec twice [2 ];
31+ struct timespec twice [2 ] = {
32+ * ts ,
33+ * ts
34+ };
3235 struct stat st ;
3336
3437 assert (path );
@@ -41,9 +44,6 @@ static int apply_timestamp(const char *path, struct timespec *ts) {
4144 return 0 ;
4245
4346 /* It is older? Then let's update it */
44- twice [0 ] = * ts ;
45- twice [1 ] = * ts ;
46-
4747 if (utimensat (AT_FDCWD , path , twice , AT_SYMLINK_NOFOLLOW ) < 0 ) {
4848
4949 if (errno == EROFS )
@@ -74,9 +74,6 @@ static int apply_timestamp(const char *path, struct timespec *ts) {
7474
7575 (void ) loop_write (fd , MESSAGE , strlen (MESSAGE ), false);
7676
77- twice [0 ] = * ts ;
78- twice [1 ] = * ts ;
79-
8077 if (futimens (fd , twice ) < 0 )
8178 return log_error_errno (errno , "Failed to update timestamp on %s: %m" , path );
8279 } else
You can’t perform that action at this time.
0 commit comments