Skip to content

Commit

Permalink
Change to use futimesat without flag arg
Browse files Browse the repository at this point in the history
This is the standard version. We used an extra flags arg before as I
thought unar needed it, but it builds fine without it.  Other
packages, like for example coreutils, needs the standard version.
  • Loading branch information
Grimler91 committed Mar 30, 2024
1 parent e7e567e commit 155baa8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sys_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,16 @@ int futimes(int fd, const struct timeval tv[2]) {
return futimens(fd, tv ? ts : NULL);
}

int futimesat(int fd, const char* path, const struct timeval tv[2], int flags) {
int futimesat(int fd, const char* path, const struct timeval tv[2]) {
struct timespec ts[2];
if (tv && (!timespec_from_timeval(&ts[0], tv[0]) || !timespec_from_timeval(&ts[1], tv[1]))) {
errno = EINVAL;
return -1;
}
return utimensat(fd, path, tv ? ts : NULL, flags);
return utimensat(fd, path, tv ? ts : NULL, 0);

}

int lutimes(const char* path, const struct timeval tv[2]) {
return futimesat(AT_FDCWD, path, tv, AT_SYMLINK_NOFOLLOW);
int lutimes(const char* path, const struct timespec ts[2]) {
return utimensat(AT_FDCWD, path, ts, AT_SYMLINK_NOFOLLOW);
}

0 comments on commit 155baa8

Please sign in to comment.