summaryrefslogtreecommitdiffstats
path: root/polyp/main.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-09-14 17:52:11 +0000
committerLennart Poettering <lennart@poettering.net>2004-09-14 17:52:11 +0000
commit8c6593dabf3253e20fead143855267570a403c9a (patch)
tree46ab7f2f77375113d2e8f0461a512688b0aa8857 /polyp/main.c
parent829656c5fcd7169e4c2f86f4ad5098ea9aaa5643 (diff)
add module-combine
remove option "stay-root" clean up pa_conf git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@199 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/main.c')
-rw-r--r--polyp/main.c57
1 files changed, 29 insertions, 28 deletions
diff --git a/polyp/main.c b/polyp/main.c
index 148dfac2..9de69ca6 100644
--- a/polyp/main.c
+++ b/polyp/main.c
@@ -124,6 +124,11 @@ int main(int argc, char *argv[]) {
pa_log_set_target(conf->auto_log_target ? PA_LOG_STDERR : conf->log_target, NULL);
+ if (conf->high_priority && conf->cmd == PA_CMD_DAEMON)
+ pa_raise_priority();
+
+ drop_root();
+
if (conf->dl_search_path)
lt_dlsetsearchpath(conf->dl_search_path);
#ifdef DLSEARCHPATH
@@ -131,37 +136,33 @@ int main(int argc, char *argv[]) {
lt_dlsetsearchpath(DLSEARCHPATH);
#endif
- if (conf->dump_modules) {
- pa_dump_modules(conf, argc-d, argv+d);
- retval = 0;
- goto finish;
- }
-
- if (conf->dump_conf) {
- char *s = pa_conf_dump(conf);
- fputs(s, stdout);
- pa_xfree(s);
- retval = 0;
- goto finish;
- }
+ switch (conf->cmd) {
+ case PA_CMD_DUMP_MODULES:
+ pa_dump_modules(conf, argc-d, argv+d);
+ retval = 0;
+ goto finish;
- if (conf->help) {
- pa_cmdline_help(argv[0]);
- retval = 0;
- goto finish;
- }
+ case PA_CMD_DUMP_CONF: {
+ char *s = pa_conf_dump(conf);
+ fputs(s, stdout);
+ pa_xfree(s);
+ retval = 0;
+ goto finish;
+ }
- if (conf->version) {
- printf(PACKAGE_NAME" "PACKAGE_VERSION"\n");
- retval = 0;
- goto finish;
- }
+ case PA_CMD_HELP :
+ pa_cmdline_help(argv[0]);
+ retval = 0;
+ goto finish;
- if (conf->high_priority)
- pa_raise_priority();
-
- if (!conf->stay_root)
- drop_root();
+ case PA_CMD_VERSION :
+ printf(PACKAGE_NAME" "PACKAGE_VERSION"\n");
+ retval = 0;
+ goto finish;
+
+ default:
+ assert(conf->cmd == PA_CMD_DAEMON);
+ }
if (conf->daemonize) {
pid_t child;