]> git.proxmox.com Git - mirror_frr.git/blobdiff - nhrpd/znl.c
nhrpd: fix issues found by coverity
[mirror_frr.git] / nhrpd / znl.c
index 2216d97eb81cb2054a58f98ecd236e27062ed752..5e9864c4d8ef45c9f754aac0189ef86d4e113446 100644 (file)
@@ -141,8 +141,10 @@ int znl_open(int protocol, int groups)
        if (fd < 0)
                return -1;
 
-       fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK);
-       fcntl(fd, F_SETFD, FD_CLOEXEC);
+       if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK) < 0)
+               goto error;
+       if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0)
+               goto error;
        if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &buf, sizeof(buf)) < 0)
                goto error;