]> granicus.if.org Git - libnl/commitdiff
nl: Return -NLE_AGAIN if non-blocking socket would block
authorThomas Graf <tgraf@suug.ch>
Tue, 2 Apr 2013 09:58:18 +0000 (11:58 +0200)
committerThomas Graf <tgraf@suug.ch>
Tue, 2 Apr 2013 09:58:18 +0000 (11:58 +0200)
Previously 0 was returned which gave the caller no chance of detecting
when a non-blocking socket would block. If a caller intends to never
see an error message it should utilize poll()/select() to only read
when the socket has pending data or information.

Reported-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
lib/nl.c

index fa43c56ca161d1e21e1b793cf00f6aca9241a924..0445e35d5b86912710665771d5d447db2316e1f3 100644 (file)
--- a/lib/nl.c
+++ b/lib/nl.c
@@ -627,11 +627,6 @@ retry:
                        NL_DBG(3, "recvmsg() returned EINTR, retrying\n");
                        goto retry;
                }
-               if (errno == EAGAIN || errno == EWOULDBLOCK) {
-                       NL_DBG(3, "recvmsg() returned EAGAIN||EWOULDBLOCK, aborting\n");
-                       retval = 0;
-                       goto abort;
-               }
                retval = -nl_syserr2nlerr(errno);
                goto abort;
        }