X-Git-Url: https://git.decadent.org.uk/gitweb/?p=odhcp6c.git;a=blobdiff_plain;f=src%2Fra.c;h=09d5c1d9ce5985dd6300c4dca3d53ff3c0d60849;hp=95416240b2113fa313aa35bf2b55fcca4f69575c;hb=ec864c44e9959a5d65cc564182f4e960e47c6e9e;hpb=0812d31deabe32918fd5b9498f0a8b2c2962d70b diff --git a/src/ra.c b/src/ra.c index 9541624..09d5c1d 100644 --- 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; }