aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/portability.h6
-rw-r--r--toys/posix/rm.c2
2 files changed, 1 insertions, 7 deletions
diff --git a/lib/portability.h b/lib/portability.h
index 143d10f6..70e33bf6 100644
--- a/lib/portability.h
+++ b/lib/portability.h
@@ -150,12 +150,6 @@ int utimensat(int fd, const char *path, const struct timespec times[2], int flag
#include <libgen.h>
#endif
-#ifdef __MUSL__
-#include <unistd.h>
-// Without this "rm -r dir" fails with "is directory".
-#define faccessat(A, B, C, D) faccessat(A, B, C, 0)
-#endif
-
// Work out how to do endianness
#ifndef __APPLE__
diff --git a/toys/posix/rm.c b/toys/posix/rm.c
index 9561a670..7b7916c2 100644
--- a/toys/posix/rm.c
+++ b/toys/posix/rm.c
@@ -48,7 +48,7 @@ static int do_rm(struct dirtree *try)
// handle directory recursion
if (dir) {
// Handle chmod 000 directories when -f
- if (faccessat(fd, try->name, R_OK, AT_SYMLINK_NOFOLLOW)) {
+ if (faccessat(fd, try->name, R_OK, 0)) {
if (toys.optflags & FLAG_f) wfchmodat(fd, try->name, 0700);
else goto skip;
}