]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Convert network.c to use new error subsystem codes
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 20 Aug 2018 13:50:31 +0000 (09:50 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 6 Sep 2018 20:50:58 +0000 (20:50 +0000)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/network.c

index 6d3350ad4909ef626b339bd2a88981ce959fcc20..41bd321bcc0a9f194420ddddca27036bbe359977 100644 (file)
@@ -22,6 +22,7 @@
 #include <zebra.h>
 #include "log.h"
 #include "network.h"
+#include "lib_errors.h"
 
 /* Read nbytes from fd and store into ptr. */
 int readn(int fd, uint8_t *ptr, int nbytes)
@@ -78,13 +79,15 @@ int set_nonblocking(int fd)
           should
           never be negative. */
        if ((flags = fcntl(fd, F_GETFL)) < 0) {
-               zlog_warn("fcntl(F_GETFL) failed for fd %d: %s", fd,
-                         safe_strerror(errno));
+               flog_err(LIB_ERR_SYSTEM_CALL,
+                        "fcntl(F_GETFL) failed for fd %d: %s", fd,
+                        safe_strerror(errno));
                return -1;
        }
        if (fcntl(fd, F_SETFL, (flags | O_NONBLOCK)) < 0) {
-               zlog_warn("fcntl failed setting fd %d non-blocking: %s", fd,
-                         safe_strerror(errno));
+               flog_err(LIB_ERR_SYSTEM_CALL,
+                        "fcntl failed setting fd %d non-blocking: %s", fd,
+                        safe_strerror(errno));
                return -1;
        }
        return 0;