deliver_process_signal (signal, handle_profiler_signal);
}
-static enum profiler_cpu_running
+static int
setup_cpu_timer (Lisp_Object sampling_interval)
{
struct sigaction action;
? ((EMACS_INT) TYPE_MAXIMUM (time_t) * billion
+ (billion - 1))
: EMACS_INT_MAX)))
- return NOT_RUNNING;
+ return -1;
current_sampling_interval = XINT (sampling_interval);
interval = make_timespec (current_sampling_interval / billion,
profiler_max_stack_depth);
}
- profiler_cpu_running = setup_cpu_timer (sampling_interval);
- if (! profiler_cpu_running)
- error ("Invalid sampling interval");
+ int status = setup_cpu_timer (sampling_interval);
+ if (status == -1)
+ {
+ profiler_cpu_running = NOT_RUNNING;
+ error ("Invalid sampling interval");
+ }
+ else
+ {
+ profiler_cpu_running = status;
+ if (! profiler_cpu_running)
+ error ("Unable to start profiler timer");
+ }
return Qt;
}