X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=main.c;h=e2d3f136f07c653b3b7ec4818f25b736fa607c50;hp=b70ed0597da7475065f37c98dcfaef6fbcdb71d7;hb=882882e0e2f6c451c4b9a5aa8209aa60352049c9;hpb=b0bd74e35e935aa976b68c594def4e8d2c22ef95 diff --git a/main.c b/main.c index b70ed05..e2d3f13 100644 --- a/main.c +++ b/main.c @@ -174,6 +174,7 @@ int main(int argc, char *argv[]) created_lock = 0, created_signal = 0, created_debug = 0, created_misdn = 0; char tracetext[256], lock[128]; + char options_error[256]; #if 0 /* init fdset */ @@ -242,14 +243,15 @@ int main(int argc, char *argv[]) /* query available isdn ports */ if (!(strcasecmp(argv[1],"query"))) { + int rc; fprintf(stderr, "-> Using 'misdn_info'\n"); - system("misdn_info"); + rc = system("misdn_info"); ret = 0; goto free; } /* read options */ - if (read_options() == 0) { + if (read_options(options_error) == 0) { PERROR("%s", options_error); goto free; } @@ -458,7 +460,11 @@ int main(int argc, char *argv[]) usleep(10000); } #else - select_main(0, NULL, NULL, NULL); + if (options.polling) + if (!select_main(1, NULL, NULL, NULL)) + usleep(10000); + else + select_main(0, NULL, NULL, NULL); #endif } SPRINT(tracetext, "%s terminated", NAME);