diff options
Diffstat (limited to 'wiki.c')
-rw-r--r-- | wiki.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,4 +1,5 @@ #define _POSIX_C_SOURCE 200809L +#define _GNU_SOURCE #include <stdlib.h> #include <stdio.h> @@ -20,14 +21,14 @@ int writable(char *path) { struct stat s; if(!stat(path, &s)) { if(S_ISREG(s.st_mode)) - return !access(path, W_OK); + return !eaccess(path, W_OK); else if(S_ISDIR(s.st_mode)) return 0; } char *dir = dirname(strdup(path)); if(!stat(dir, &s)) { if(S_ISDIR(s.st_mode)) - return !access(dir, W_OK); + return !eaccess(dir, W_OK); } return 0; } |