From 6cf66bb0a02f3993394c0408c2865bfaf2756f21 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Kelleter?= Date: Thu, 3 Nov 2016 13:40:53 +0100 Subject: [PATCH] system-linux: check for open failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Günther Kelleter --- system-linux.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.30.2