From bc199a9c3100b48d8109a010006655bf8ea1895b Mon Sep 17 00:00:00 2001 From: the little girl Date: Fri, 21 Feb 2014 17:33:12 +0100 Subject: access -> eaccess --- wiki.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wiki.c b/wiki.c index d8fd11c..cfb085e 100644 --- a/wiki.c +++ b/wiki.c @@ -1,4 +1,5 @@ #define _POSIX_C_SOURCE 200809L +#define _GNU_SOURCE #include #include @@ -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; } -- cgit v1.0