]> git.sur5r.net Git - ngadmin/blobdiff - raw/src/net.c
Fix handling of timeout errors
[ngadmin] / raw / src / net.c
index 83a69f3c9ad68a4f9405676e7798354a6de4b20e..78bf4ac419b9a8245c83eba3b6924c6b287f1552 100644 (file)
@@ -116,8 +116,10 @@ int recvNsdpPacket (int sock, struct nsdp_cmd *nc, List *attr, const struct time
                        timeval_to_timespec(&timeend, &tv);
 #endif
                        timewait = timespec_diff_ms(&timecurrent, &timeend);
-                       if (timewait <= 0)
+                       if (timewait <= 0) {
+                               len = -ETIMEDOUT;
                                break;
+                       }
                }
                
                len = poll(&fds, 1, timewait);