From 44019f6542885fd684c5113c7a5c06308a51102a Mon Sep 17 00:00:00 2001 From: Christian Ruppert Date: Thu, 26 Jan 2012 20:44:33 +0100 Subject: Add is_writable() function to check whether a path is writable or not --- src/includes/rc-misc.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/includes') diff --git a/src/includes/rc-misc.h b/src/includes/rc-misc.h index 773c4b9..18ed5b9 100644 --- a/src/includes/rc-misc.h +++ b/src/includes/rc-misc.h @@ -36,6 +36,7 @@ #include #include #include +#include #define RC_LEVEL_BOOT "boot" #define RC_LEVEL_DEFAULT "default" @@ -166,6 +167,12 @@ int svc_lock(const char *); int svc_unlock(const char *, int); pid_t exec_service(const char *, const char *); +/* + * Check whether path is writable or not, + * this also works properly with read-only filesystems + */ +int is_writable(const char *); + #define service_start(service) exec_service(service, "start"); #define service_stop(service) exec_service(service, "stop"); -- cgit v1.2.3