summaryrefslogtreecommitdiff
path: root/src/ra.c
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2015-03-28 17:58:44 +0100
committerSteven Barth <steven@midlink.org>2015-03-30 13:58:07 +0200
commitec864c44e9959a5d65cc564182f4e960e47c6e9e (patch)
treeeea22d612485c3ed20ad376cbc19915b93cc6df0 /src/ra.c
parent0812d31deabe32918fd5b9498f0a8b2c2962d70b (diff)
downloadodhcp6c-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.c6
1 files changed, 4 insertions, 2 deletions
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;
}