#include <config.h>
#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 <errno.h>
#include <stdio.h>
#include <string.h>
-#include <sys/time.h>
#include <unistd.h>
#include <signal.h>
static struct sigaction sigaction_prev;
/* Nonzero after pa_cpu_limit_init() */
-static pa_bool_t installed = FALSE;
+static bool installed = false;
/* The current state of operation */
-static enum {
+static enum {
PHASE_IDLE, /* Normal state */
PHASE_SOFT /* After CPU overload has been detected */
} phase = PHASE_IDLE;
write_err("Soft CPU time limit exhausted, terminating.\n");
/* Try a soft cleanup */
- (void) write(the_pipe[1], &c, sizeof(c));
+ (void) pa_write(the_pipe[1], &c, sizeof(c), NULL);
phase = PHASE_SOFT;
reset_cpu_time(CPUTIME_INTERVAL_HARD);
pa_log("Received request to terminate due to CPU overload.");
- pa_read(the_pipe[0], &c, sizeof(c), NULL);
+ (void) pa_read(the_pipe[0], &c, sizeof(c), NULL);
m->quit(m, 1); /* Quit the main loop */
}
return -1;
}
- installed = TRUE;
+ installed = true;
reset_cpu_time(CPUTIME_INTERVAL_SOFT);
if (installed) {
pa_assert_se(sigaction(SIGXCPU, &sigaction_prev, NULL) >= 0);
- installed = FALSE;
+ installed = false;
}
}