[pulseaudio-commits] r1286 - in /trunk/src/daemon: daemon-conf.c daemon-conf.h main.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Fri Aug 18 18:20:15 PDT 2006


Author: lennart
Date: Sat Aug 19 03:20:13 2006
New Revision: 1286

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1286&root=pulseaudio&view=rev
Log:
add new "disable-shm" server config option

Modified:
    trunk/src/daemon/daemon-conf.c
    trunk/src/daemon/daemon-conf.h
    trunk/src/daemon/main.c

Modified: trunk/src/daemon/daemon-conf.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/daemon/daemon-conf.c?rev=1286&root=pulseaudio&r1=1285&r2=1286&view=diff
==============================================================================
--- trunk/src/daemon/daemon-conf.c (original)
+++ trunk/src/daemon/daemon-conf.c Sat Aug 19 03:20:13 2006
@@ -73,7 +73,8 @@
     .config_file = NULL,
     .use_pid_file = 1,
     .system_instance = 0,
-    .no_cpu_limit = 0
+    .no_cpu_limit = 0,
+    .disable_shm = 0
 #ifdef HAVE_SYS_RESOURCE_H
     , .rlimit_as = { .value = 0, .is_set = 0 },
     .rlimit_core = { .value = 0, .is_set = 0 },
@@ -248,6 +249,7 @@
         { "use-pid-file",            pa_config_parse_bool,    NULL },
         { "system-instance",         pa_config_parse_bool,    NULL },
         { "no-cpu-limit",            pa_config_parse_bool,    NULL },
+        { "disable-shm",             pa_config_parse_bool,    NULL },
 #ifdef HAVE_SYS_RESOURCE_H
         { "rlimit-as",               parse_rlimit,            NULL },
         { "rlimit-core",             parse_rlimit,            NULL },
@@ -281,21 +283,22 @@
     table[13].data = &c->use_pid_file;
     table[14].data = &c->system_instance;
     table[15].data = &c->no_cpu_limit;
-#ifdef HAVE_SYS_RESOURCE_H
-    table[16].data = &c->rlimit_as;
-    table[17].data = &c->rlimit_core;
-    table[18].data = &c->rlimit_data;
-    table[19].data = &c->rlimit_fsize;
-    table[20].data = &c->rlimit_nofile;
-    table[21].data = &c->rlimit_stack;
+    table[16].data = &c->disable_shm;
+#ifdef HAVE_SYS_RESOURCE_H
+    table[17].data = &c->rlimit_as;
+    table[18].data = &c->rlimit_core;
+    table[19].data = &c->rlimit_data;
+    table[20].data = &c->rlimit_fsize;
+    table[21].data = &c->rlimit_nofile;
+    table[22].data = &c->rlimit_stack;
 #ifdef RLIMIT_NPROC
-    table[22].data = &c->rlimit_nproc;
+    table[23].data = &c->rlimit_nproc;
 #endif
 #ifdef RLIMIT_MEMLOCK
 #ifndef RLIMIT_NPROC
 #error "Houston, we have a numbering problem!"
 #endif
-    table[23].data = &c->rlimit_memlock;
+    table[24].data = &c->rlimit_memlock;
 #endif
 #endif
     
@@ -367,6 +370,7 @@
     pa_strbuf_printf(s, "use-pid-file = %i\n", c->use_pid_file);
     pa_strbuf_printf(s, "system-instance = %i\n", !!c->system_instance);
     pa_strbuf_printf(s, "no-cpu-limit = %i\n", !!c->no_cpu_limit);
+    pa_strbuf_printf(s, "disable_shm = %i\n", !!c->disable_shm);
 #ifdef HAVE_SYS_RESOURCE_H
     pa_strbuf_printf(s, "rlimit-as = %li\n", c->rlimit_as.is_set ? (long int) c->rlimit_as.value : -1);
     pa_strbuf_printf(s, "rlimit-core = %li\n", c->rlimit_core.is_set ? (long int) c->rlimit_core.value : -1);

Modified: trunk/src/daemon/daemon-conf.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/daemon/daemon-conf.h?rev=1286&root=pulseaudio&r1=1285&r2=1286&view=diff
==============================================================================
--- trunk/src/daemon/daemon-conf.h (original)
+++ trunk/src/daemon/daemon-conf.h Sat Aug 19 03:20:13 2006
@@ -59,7 +59,8 @@
         auto_log_target,
         use_pid_file,
         system_instance,
-        no_cpu_limit;
+        no_cpu_limit,
+        disable_shm;
     char *script_commands, *dl_search_path, *default_script_file;
     pa_log_target_t log_target;
     pa_log_level_t log_level;

Modified: trunk/src/daemon/main.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/daemon/main.c?rev=1286&root=pulseaudio&r1=1285&r2=1286&view=diff
==============================================================================
--- trunk/src/daemon/main.c (original)
+++ trunk/src/daemon/main.c Sat Aug 19 03:20:13 2006
@@ -306,10 +306,10 @@
 #endif
 
 int main(int argc, char *argv[]) {
-    pa_core *c;
+    pa_core *c = NULL;
     pa_strbuf *buf = NULL;
-    pa_daemon_conf *conf;
-    pa_mainloop *mainloop;
+    pa_daemon_conf *conf = NULL;
+    pa_mainloop *mainloop = NULL;
 
     char *s; 
     int r, retval = 1, d = 0;
@@ -559,8 +559,9 @@
     mainloop = pa_mainloop_new();
     assert(mainloop);
 
-    c = pa_core_new(pa_mainloop_get_api(mainloop), 1);
-    assert(c);
+    if (!(c = pa_core_new(pa_mainloop_get_api(mainloop), !conf->disable_shm)))
+        goto finish;
+
     c->is_system_instance = !!conf->system_instance;
 
     r = pa_signal_init(pa_mainloop_get_api(mainloop));
@@ -651,11 +652,13 @@
         pa_cpu_limit_done();
     
     pa_signal_done();
-    pa_mainloop_free(mainloop);
     
     pa_log_info("Daemon terminated.");
     
 finish:
+
+    if (mainloop)
+        pa_mainloop_free(mainloop);
 
     if (conf)
         pa_daemon_conf_free(conf);




More information about the pulseaudio-commits mailing list