diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-08-20 15:50:31 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-09-06 22:50:58 +0200 |
commit | fc41c1531ff1c493a0f92a97dee3da4451b63652 (patch) | |
tree | 8a90b65711f4e5aca9f861e93f9c799ba9b1b9ca /lib | |
parent | lib: Convert thread.c to use new error-code subsystem (diff) | |
download | frr-fc41c1531ff1c493a0f92a97dee3da4451b63652.tar.xz frr-fc41c1531ff1c493a0f92a97dee3da4451b63652.zip |
lib: Convert network.c to use new error subsystem codes
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/network.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/network.c b/lib/network.c index 6d3350ad4..41bd321bc 100644 --- a/lib/network.c +++ b/lib/network.c @@ -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; |