Alright, the Android guys agree with the musl guys: faccessat(AT_SYMLINK_NOFOLLOW...
authorRob Landley <rob@landley.net>
Fri, 6 Feb 2015 22:42:44 +0000 (16:42 -0600)
committerRob Landley <rob@landley.net>
Fri, 6 Feb 2015 22:42:44 +0000 (16:42 -0600)
lib/portability.h
toys/posix/rm.c

index 143d10f..70e33bf 100644 (file)
@@ -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__
index 9561a67..7b7916c 100644 (file)
@@ -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;
     }