diff options
Diffstat (limited to 'src/odhcpd.c')
-rw-r--r-- | src/odhcpd.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/odhcpd.c b/src/odhcpd.c index 0e0002d..7c6c144 100644 --- a/src/odhcpd.c +++ b/src/odhcpd.c @@ -128,6 +128,9 @@ int odhcpd_get_interface_config(const char *ifname, const char *what) snprintf(buf, sizeof(buf), sysctl_pattern, ifname, what); int fd = open(buf, O_RDONLY); + if (fd < 0) + return -1; + ssize_t len = read(fd, buf, sizeof(buf) - 1); close(fd); |