X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=server.c;h=2f66dc4da17833b2ac32464746645e978d8752c8;hp=8f20763fb44ed01327514b92837dceb8b0f66021;hb=d7cda933daa35663b2b9b61d62cb514afa37fd18;hpb=f2a7b00cf72104a38733b7bf3add9fb19dd71c93 diff --git a/server.c b/server.c index 8f20763f..2f66dc4d 100644 --- a/server.c +++ b/server.c @@ -41,6 +41,7 @@ #include "daemon.h" #include "string.h" #include "ipc.h" +#include "fd.h" /** define the array of error lists needed by para_server */ INIT_SERVER_ERRLISTS; @@ -436,7 +437,7 @@ int main(int argc, char *argv[]) /* listen on sock_fd, new connection on new_fd */ int sockfd, new_fd; struct sockaddr_in their_addr; - int err, i, max_fileno, ret; + int i, max_fileno, ret; pid_t chld_pid; fd_set rfds, wfds; struct timeval *timeout; @@ -469,21 +470,14 @@ repeat: max_fileno = MAX(max_fileno, ret); } mmd_unlock(); -// PARA_DEBUG_LOG("%s: select (max = %i)\n", __func__, max_fileno); - ret = select(max_fileno + 1, &rfds, &wfds, NULL, timeout); - err = errno; - //PARA_DEBUG_LOG("%s: select returned %i\n", __func__, ret); + ret = para_select(max_fileno + 1, &rfds, &wfds, timeout); mmd_lock(); if (mmd->selector_change >= 0) change_selector(); if (selectors[mmd->selector_num].post_select) selectors[mmd->selector_num].post_select(&rfds, &wfds); - if (ret < 0 && err == EINTR) - goto repeat; - if (ret < 0) { - PARA_CRIT_LOG("select error (%s)\n", strerror(err)); + if (ret < 0) goto repeat; - } for (i = 0; senders[i].name; i++) { if (senders[i].status != SENDER_ON) continue;