diff --git a/syscall.c b/syscall.c index 73fddf00..44016dfa 100644 --- a/syscall.c +++ b/syscall.c @@ -1485,8 +1485,8 @@ int do_chmod(const char *path, mode_t mode) * exists we skip with a warning rather than follow the leaf. */ static int do_fchmodat_nofollow(int dfd, const char *name, mode_t mode) { - mode &= CHMOD_BITS; #if defined AT_FDCWD && defined AT_SYMLINK_NOFOLLOW + mode &= CHMOD_BITS; # if defined __linux__ { STRUCT_STAT st; @@ -1532,6 +1532,8 @@ static int do_fchmodat_nofollow(int dfd, const char *name, mode_t mode) return fchmodat(dfd, name, mode, AT_SYMLINK_NOFOLLOW); # endif #else + (void)dfd; + (void)mode; /* No symlink-safe chmod primitive here: skip rather than follow the leaf. */ rprintf(FWARNING, "do_chmod: no symlink-safe chmod for \"%s\"; mode not set\n", name); return 1;