nl: Return -NLE_AGAIN if non-blocking socket would block
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>
This commit is contained in:
parent
df66b0f267
commit
375a6294a4
1 changed files with 0 additions and 5 deletions
5
lib/nl.c
5
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue