X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=secnet.git;a=blobdiff_plain;f=secnet.c;h=f9808b78b828baf036cd3359bb5246f84bbbe7b4;hp=2bf50fd40992406108e297cb0dd63cbfe0d24244;hb=5a8a70536e4fa79612405a88c50743976abb2d50;hpb=29672515f5b2864a1e5b849a209cefd2adfac757 diff --git a/secnet.c b/secnet.c index 2bf50fd..f9808b7 100644 --- a/secnet.c +++ b/secnet.c @@ -62,7 +62,7 @@ static void parse_options(int argc, char **argv) {"nodetach", 0, 0, 'n'}, {"silent", 0, 0, 'f'}, {"quiet", 0, 0, 'f'}, - {"debug", 1, 0, 'd'}, + {"debug", 0, 0, 'd'}, {"config", 1, 0, 'c'}, {"just-check-config", 0, 0, 'j'}, {"sites-key", 1, 0, 's'}, @@ -87,7 +87,7 @@ static void parse_options(int argc, char **argv) " -s, --sites-key=name configuration key that " "specifies active sites\n" " -n, --nodetach do not run in background\n" - " -d, --debug=item,... set debug options\n" + " -d, --debug output debug messages\n" " --help display this help and exit\n" " --version output version information " "and exit\n" @@ -141,6 +141,7 @@ static void parse_options(int argc, char **argv) break; case '?': + exit(1); break; default: @@ -309,8 +310,11 @@ static void run(void) ((uint64_t)tv_now_global.tv_usec/(uint64_t)1000); idx=0; for (i=reg; i; i=i->next) { - if(fds[idx].revents & POLLNVAL) { - fatal("run: poll (%s) set POLLNVAL", i->desc); + int check; + for (check=0; checknfds; check++) { + if(fds[idx+check].revents & POLLNVAL) { + fatal("run: poll (%s#%d) set POLLNVAL", i->desc, check); + } } i->after(i->state, fds+idx, i->nfds); idx+=i->nfds;