diff options
author | John Crispin <blogic@openwrt.org> | 2015-03-28 17:58:44 +0100 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2015-03-30 13:58:07 +0200 |
commit | ec864c44e9959a5d65cc564182f4e960e47c6e9e (patch) | |
tree | eea22d612485c3ed20ad376cbc19915b93cc6df0 /src/ra.c | |
parent | 0812d31deabe32918fd5b9498f0a8b2c2962d70b (diff) | |
download | odhcp6c-ec864c44e9959a5d65cc564182f4e960e47c6e9e.tar.gz |
properly handle return codes
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'src/ra.c')
-rw-r--r-- | src/ra.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; } |