]> code.delx.au - pulseaudio/blobdiff - src/daemon/cpulimit.c
Merge remote branch 'phish3/master'
[pulseaudio] / src / daemon / cpulimit.c
index 5f24474db611451a2970b8f3b6e155b50cf254dd..c2877ecfb2a326256f71663d73e44ec0924ff00b 100644 (file)
@@ -5,7 +5,7 @@
 
   PulseAudio is free software; you can redistribute it and/or modify
   it under the terms of the GNU Lesser General Public License as
-  published by the Free Software Foundation; either version 2 of the
+  published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
 
   PulseAudio is distributed in the hope that it will be useful, but
 #endif
 
 #include <pulse/error.h>
+#include <pulse/rtclock.h>
 #include <pulse/timeval.h>
 
+#include <pulsecore/core-rtclock.h>
 #include <pulsecore/core-util.h>
 #include <pulsecore/core-error.h>
 #include <pulsecore/log.h>
 #include <pulsecore/macro.h>
-#include <pulsecore/rtclock.h>
 
 #include "cpulimit.h"
 
@@ -125,7 +126,7 @@ static void signal_handler(int sig) {
         char t[256];
 #endif
 
-        now = pa_rtclock_usec();
+        now = pa_rtclock_now();
         elapsed = now - last_time;
 
 #ifdef PRINT_CPU_LOAD
@@ -139,7 +140,7 @@ static void signal_handler(int sig) {
             write_err("Soft CPU time limit exhausted, terminating.\n");
 
             /* Try a soft cleanup */
-            write(the_pipe[1], &c, sizeof(c));
+            (void) write(the_pipe[1], &c, sizeof(c));
             phase = PHASE_SOFT;
             reset_cpu_time(CPUTIME_INTERVAL_HARD);
 
@@ -184,7 +185,7 @@ int pa_cpu_limit_init(pa_mainloop_api *m) {
     pa_assert(the_pipe[1] == -1);
     pa_assert(!installed);
 
-    last_time = pa_rtclock_usec();
+    last_time = pa_rtclock_now();
 
     /* Prepare the main loop pipe */
     if (pipe(the_pipe) < 0) {