]> code.delx.au - pulseaudio/blobdiff - polyp/cmdline.c
add option to disallow module loading after startup
[pulseaudio] / polyp / cmdline.c
index c07e7bdc590eb95d7a3a33bf92b79445b41e00c3..265e0ec88e90b486aae81abe2643af0d1db9a181 100644 (file)
@@ -72,6 +72,7 @@ void pa_cmdline_help(const char *argv0) {
            "  -C         Open a command line on the running TTY\n"
            "  -n         Don't load configuration file (%s)\n"
            "  -D         Daemonize after loading the modules\n"
+           "  -d         Disallow module loading after startup\n"
            "  -f         Dont quit when the startup fails\n"
            "  -v         Verbose startup\n"
            "  -h         Show this help\n"
@@ -88,13 +89,19 @@ struct pa_cmdline* pa_cmdline_parse(int argc, char * const argv []) {
     assert(argc && argv);
 
     cmdline = pa_xmalloc(sizeof(struct pa_cmdline));
-    cmdline->daemonize = cmdline->help = cmdline->verbose = cmdline->high_priority = cmdline->stay_root = cmdline->version = 0;
+    cmdline->daemonize =
+        cmdline->help =
+        cmdline->verbose =
+        cmdline->high_priority =
+        cmdline->stay_root =
+        cmdline->version =
+        cmdline->disallow_module_loading = 0;
     cmdline->fail = 1;
 
     buf = pa_strbuf_new();
     assert(buf);
     
-    while ((c = getopt(argc, argv, "L:F:CDhfvrRVn")) != -1) {
+    while ((c = getopt(argc, argv, "L:F:CDhfvrRVnd")) != -1) {
         switch (c) {
             case 'L':
                 pa_strbuf_printf(buf, "load %s\n", optarg);
@@ -127,9 +134,11 @@ struct pa_cmdline* pa_cmdline_parse(int argc, char * const argv []) {
                 cmdline->version = 1;
                 break;
             case 'n':
-                no_default_config_file =1;
+                no_default_config_file = 1;
+                break;
+            case 'd':
+                cmdline->disallow_module_loading = 1;
                 break;
-                
             default:
                 goto fail;
         }