summaryrefslogtreecommitdiff
path: root/src/rc
diff options
context:
space:
mode:
Diffstat (limited to 'src/rc')
-rw-r--r--src/rc/rc-misc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rc/rc-misc.c b/src/rc/rc-misc.c
index a06ff08..27397d7 100644
--- a/src/rc/rc-misc.c
+++ b/src/rc/rc-misc.c
@@ -331,3 +331,12 @@ parse_mode(mode_t *mode, char *text)
errno = EINVAL;
return -1;
}
+
+int
+is_writable(const char *path)
+{
+ if (access(path, W_OK) == 0)
+ return 1;
+
+ return 0;
+}