X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=recv.c;h=af15eb07efb005f8b959e764d74b1bf2a27db60d;hp=fd82bc0fa6d998e51072284aefe1dc5d79dd3663;hb=1b39496da38155b84636c0f7cee7f7dbbea33632;hpb=adbf9f09c9bf2a680c61b1ef3541c04f1cde97cf diff --git a/recv.c b/recv.c index fd82bc0f..af15eb07 100644 --- a/recv.c +++ b/recv.c @@ -19,6 +19,7 @@ #include "recv.h" #include "recv.cmdline.h" +#include "fd.h" #include "error.h" struct gengetopt_args_info conf; @@ -81,16 +82,14 @@ recv: FD_ZERO(&rfds); FD_ZERO(&wfds); timeout.tv_sec = 0; - timeout.tv_usec = 1000 * 1000; + timeout.tv_usec = 999 * 1000; max = -1; ret = r->pre_select(&rn, &rfds, &wfds, &timeout); - max = MAX(max, ret); + max = PARA_MAX(max, ret); - PARA_DEBUG_LOG("timeout: %lums\n", tv2ms(&timeout)); - ret = select(max + 1, &rfds, &wfds, NULL, &timeout); + PARA_DEBUG_LOG("timeout: %lums, max: %d\n", tv2ms(&timeout), max); + ret = para_select(max + 1, &rfds, &wfds, &timeout); if (ret < 0) { - if (errno == EINTR || errno == EAGAIN) - goto recv; ret = -E_RECV_SELECT; goto out; }