]> git.decadent.org.uk Git - odhcp6c.git/blobdiff - src/ra.c
properly handle return codes
[odhcp6c.git] / src / ra.c
index 95416240b2113fa313aa35bf2b55fcca4f69575c..09d5c1d9ce5985dd6300c4dca3d53ff3c0d60849 100644 (file)
--- a/src/ra.c
+++ b/src/ra.c
@@ -165,14 +165,16 @@ static int16_t pref_to_priority(uint8_t flags)
 }
 
 
-static void update_proc(const char *sect, const char *opt, uint32_t value)
+static int update_proc(const char *sect, const char *opt, uint32_t value)
 {
        char buf[64];
        snprintf(buf, sizeof(buf), "/proc/sys/net/ipv6/%s/%s/%s", sect, if_name, opt);
 
        int fd = open(buf, O_WRONLY);
-       write(fd, buf, snprintf(buf, sizeof(buf), "%u", value));
+       int ret = write(fd, buf, snprintf(buf, sizeof(buf), "%u", value));
        close(fd);
+
+       return ret;
 }