[pulseaudio-commits] r1696 - /branches/lennart/src/daemon/main.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Tue Aug 21 17:29:15 PDT 2007


Author: lennart
Date: Wed Aug 22 02:29:15 2007
New Revision: 1696

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1696&root=3Dpulseaudio&vi=
ew=3Drev
Log:
add message about hrtimers, and initialize pa_core::high_priority

Modified:
    branches/lennart/src/daemon/main.c

Modified: branches/lennart/src/daemon/main.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/daemon/mai=
n.c?rev=3D1696&root=3Dpulseaudio&r1=3D1695&r2=3D1696&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/daemon/main.c (original)
+++ branches/lennart/src/daemon/main.c Wed Aug 22 02:29:15 2007
@@ -78,6 +78,7 @@
 #include <pulsecore/pid.h>
 #include <pulsecore/namereg.h>
 #include <pulsecore/random.h>
+#include <pulsecore/rtsig.h>
 =

 #include "cmdline.h"
 #include "cpulimit.h"
@@ -395,7 +396,7 @@
     if (conf->high_priority && conf->cmd =3D=3D PA_CMD_DAEMON)
         pa_raise_priority();
 =

-    if (suid_root && conf->cmd !=3D PA_CMD_DAEMON) {
+    if (suid_root && (conf->cmd !=3D PA_CMD_DAEMON || !conf->high_priority=
)) {
         pa_drop_caps();
         pa_drop_root();
     }
@@ -543,7 +544,7 @@
 #endif
     }
 =

-    chdir("/");
+    pa_assert(chdir("/") =3D=3D 0);
     umask(0022);
 =

     if (conf->system_instance) {
@@ -573,21 +574,28 @@
     signal(SIGPIPE, SIG_IGN);
 #endif
 =

+    if (!pa_rtclock_hrtimer())
+        pa_log_debug("Fresh high-resolution timers available! Bon appetit!=
");
+    else
+        pa_log_info("Dude, your kernel stinks! The chef's recommendation t=
oday is Linux with high-resolution timers enabled!");
+    =

+    pa_rtsig_configure(SIGRTMIN+10, SIGRTMAX);
+
     mainloop =3D pa_mainloop_new();
     assert(mainloop);
 =

     if (!(c =3D pa_core_new(pa_mainloop_get_api(mainloop), !conf->disable_=
shm))) {
-            pa_log("pa_core_new() failed.");
+        pa_log("pa_core_new() failed.");
         goto finish;
     }
 =

     c->is_system_instance =3D !!conf->system_instance;
+    c->high_priority =3D !!conf->high_priority;
     c->default_sample_spec =3D conf->default_sample_spec;
     c->default_n_fragments =3D conf->default_n_fragments;
     c->default_fragment_size_msec =3D conf->default_fragment_size_msec;
 =

-    r =3D pa_signal_init(pa_mainloop_get_api(mainloop));
-    assert(r =3D=3D 0);
+    pa_assert_se(pa_signal_init(pa_mainloop_get_api(mainloop)) =3D=3D 0);
     pa_signal_new(SIGINT, signal_callback, c);
     pa_signal_new(SIGTERM, signal_callback, c);
 =





More information about the pulseaudio-commits mailing list