git » nmdb » commit 0229818

Fix UDP recvfrom() error handling.

author Alberto Bertogli
2007-06-07 06:10:09 UTC
committer Alberto Bertogli
2007-06-07 06:10:09 UTC
parent 91ffc7bbda813a858562dbfd8b84ecd879af1fc1

Fix UDP recvfrom() error handling.

The comment is valid for TIPC because it's not strictly POSIX compliant,
but UDP behaves normally.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>

nmdb/udp.c +1 -3

diff --git a/nmdb/udp.c b/nmdb/udp.c
index 40d9747..d9140a2 100644
--- a/nmdb/udp.c
+++ b/nmdb/udp.c
@@ -216,9 +216,7 @@ void udp_recv(int fd, short event, void *arg)
 
 	rv = recvfrom(fd, buf, bsize, 0, (struct sockaddr *) &clisa,
 			&clilen);
-	if (rv <= 0) {
-		/* rv == 0 means "return of an undeliverable message", which
-		 * we ignore; -1 means other error. */
+	if (rv < 0) {
 		goto exit;
 	}