+#include <errno.h>
#include <signal.h>
+#include <stdio.h>
+#include <string.h>
#include <unistd.h>
#ifdef CONFIG_HAVE_TIMERFD_CREATE
#include <sys/timerfd.h>
static void block_signals(void)
{
-#ifdef HAVE_PTHREAD_SIGMASK
+#ifdef CONFIG_PTHREAD_SIGMASK
sigset_t sigmask;
+ int ret;
+
ret = pthread_sigmask(SIG_UNBLOCK, NULL, &sigmask);
assert(ret == 0);
ret = pthread_sigmask(SIG_BLOCK, &sigmask, NULL);
- assert(ret == 0);
#endif
}
return;
ret = write_to_pipe(helper_data->pipe[1], &data, sizeof(data));
- assert(ret == 1);
+ if (ret != 1) {
+ log_err("failed to write action into pipe, err %i:%s", errno, strerror(errno));
+ assert(0);
+ }
}
void helper_reset(void)
return;
helper_data->exit = 1;
- submit_action(A_EXIT);
pthread_join(helper_data->thread, NULL);
}
},
{
.name = "steadystate",
- .interval_ms = steadystate_enabled ? STEADYSTATE_MSEC :
+ .interval_ms = steadystate_enabled ? ss_check_interval :
0,
.func = steadystate_check,
}
int ret;
hd = scalloc(1, sizeof(*hd));
+ if (!hd)
+ return 1;
setup_disk_util();
steadystate_setup();