add support for automatic termination of the daemon after the last client quit

remove all gcc warnings
add boolean types for tagstruct and modargs


git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@178 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2004-09-04 00:27:36 +00:00
parent fb962b67db
commit 57e473b61c
23 changed files with 155 additions and 37 deletions

View file

@ -75,6 +75,7 @@ void pa_cmdline_help(const char *argv0) {
" -d Disallow module loading after startup\n"
" -f Dont quit when the startup fails\n"
" -v Verbose startup\n"
" -X SECS Terminate the daemon after the last client quit and this time passed\n"
" -h Show this help\n"
" -V Show version\n", e, cfg);
@ -97,11 +98,12 @@ struct pa_cmdline* pa_cmdline_parse(int argc, char * const argv []) {
cmdline->version =
cmdline->disallow_module_loading = 0;
cmdline->fail = 1;
cmdline->quit_after_last_client_time = -1;
buf = pa_strbuf_new();
assert(buf);
while ((c = getopt(argc, argv, "L:F:CDhfvrRVnd")) != -1) {
while ((c = getopt(argc, argv, "L:F:CDhfvrRVndX:")) != -1) {
switch (c) {
case 'L':
pa_strbuf_printf(buf, "load %s\n", optarg);
@ -139,6 +141,9 @@ struct pa_cmdline* pa_cmdline_parse(int argc, char * const argv []) {
case 'd':
cmdline->disallow_module_loading = 1;
break;
case 'X':
cmdline->quit_after_last_client_time = atoi(optarg);
break;
default:
goto fail;
}