Fix preferences dialog.
[dhcpcd-ui] / src / libdhcpcd / config.c
index 709a8e841c068f6950655b10c896717c2ac0c6c9..92aad29f6225faac19f5fcb918414b3569d15f91 100644 (file)
@@ -29,6 +29,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
 #define IN_LIBDHCPCD
 
 
 #define IN_LIBDHCPCD
 
@@ -395,6 +396,13 @@ dhcpcd_config_read(DHCPCD_CONNECTION *con, const char *block, const char *name)
 }
 
 bool
 }
 
 bool
+dhcpcd_config_writeable(DHCPCD_CONNECTION *con)
+{
+
+       return (access(con->cffile, W_OK) == 0);
+}
+
+bool
 dhcpcd_config_write(DHCPCD_CONNECTION *con,
     const char *block, const char *name,
     const DHCPCD_OPTION *opts)
 dhcpcd_config_write(DHCPCD_CONNECTION *con,
     const char *block, const char *name,
     const DHCPCD_OPTION *opts)