From: Andreas Eversberg Date: Wed, 17 Mar 2010 09:43:04 +0000 (+0100) Subject: Added 'polling' option to options.conf. X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=commitdiff_plain;h=882882e0e2f6c451c4b9a5aa8209aa60352049c9;hp=2732c3ce40d8e0b3875b5a0c933c98f27c8cbae9 Added 'polling' option to options.conf. This is usefull to test if select loop causes problems and does not wake when it is required. If lcr seems not to wake up, try using 'polling' to disable select timer and use polling instead. --- diff --git a/default/options.conf b/default/options.conf index 64d0f27..e0e93a0 100644 --- a/default/options.conf +++ b/default/options.conf @@ -117,3 +117,6 @@ # #gsm +# Enable polling in main loop. +# This feature is temporarily for test purpose. Don't enable it +#polling diff --git a/main.c b/main.c index 9d7f834..e2d3f13 100644 --- a/main.c +++ b/main.c @@ -460,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); diff --git a/options.c b/options.c index 1cadbe5..88f6424 100644 --- a/options.c +++ b/options.c @@ -35,7 +35,8 @@ struct options options = { 0700, /* rights of lcr admin socket */ -1, /* socket user (-1= no change) */ -1, /* socket group (-1= no change) */ - 0 /* enable gsm */ + 0, /* enable gsm */ + 1 /* use polling of main loop */ }; char options_error[256]; @@ -235,6 +236,9 @@ int read_options(char *options_error) } else if (!strcmp(option,"gsm")) { options.gsm = 1; + } else + if (!strcmp(option,"polling")) { + options.polling = 1; } else { UPRINT(options_error, "Error in %s (line %d): wrong option keyword %s.\n", filename,line,option); goto error; diff --git a/options.h b/options.h index 1a256e2..c13ee2c 100644 --- a/options.h +++ b/options.h @@ -30,6 +30,7 @@ struct options { int socketuser; /* socket chown to this user */ int socketgroup; /* socket chgrp to this group */ int gsm; /* enable gsm support */ + int polling; }; extern struct options options; diff --git a/todo.txt b/todo.txt index c6b6993..896a0d0 100644 --- a/todo.txt +++ b/todo.txt @@ -15,5 +15,5 @@ doku: - neuen partyline-param dokumentieren - aufzeichnung der ansage mit 0 ohne beep beenden - gain, pipeline, crypt - +- polling