aboutsummaryrefslogtreecommitdiff
path: root/wiki.c
diff options
context:
space:
mode:
Diffstat (limited to 'wiki.c')
-rw-r--r--wiki.c5
1 files 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 <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;
}