From: Günther Kelleter Date: Thu, 3 Nov 2016 12:40:53 +0000 (+0100) Subject: system-linux: check for open failure X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=commitdiff_plain;h=6cf66bb0a02f3993394c0408c2865bfaf2756f21 system-linux: check for open failure Signed-off-by: Günther Kelleter --- diff --git a/system-linux.c b/system-linux.c index 6e4a194..a038987 100644 --- a/system-linux.c +++ b/system-linux.c @@ -2489,6 +2489,8 @@ int system_update_ipv6_mtu(struct device *dev, int mtu) dev->ifname); int fd = open(buf, O_RDWR); + if (fd < 0) + return ret; if (!mtu) { ssize_t len = read(fd, buf, sizeof(buf) - 1);