From 57e473b61cf373f8d9befb03d359b999eca4262b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 4 Sep 2004 00:27:36 +0000 Subject: 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 --- polyp/cmdline.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'polyp/cmdline.c') diff --git a/polyp/cmdline.c b/polyp/cmdline.c index 265e0ec8..aba20af1 100644 --- a/polyp/cmdline.c +++ b/polyp/cmdline.c @@ -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; } -- cgit