if (WIFEXITED(status)) {
if (WEXITSTATUS(status) != 0)
- log_error("worker [%u] exit with return code %i\n", pid, WEXITSTATUS(status));
+ log_error("worker [%u] exit with return code %i\n",
+ pid, WEXITSTATUS(status));
} else if (WIFSIGNALED(status)) {
log_error("worker [%u] terminated by signal %i (%s)\n",
- pid, WTERMSIG(status), strsignal(WTERMSIG(status)));
+ pid, WTERMSIG(status), strsignal(WTERMSIG(status)));
} else if (WIFSTOPPED(status)) {
log_error("worker [%u] stopped\n", pid);
} else if (WIFCONTINUED(status)) {
*/
static void kernel_cmdline_options(struct udev *udev)
{
- char *line, *w, *state;
+ _cleanup_free_ char *line = NULL;
+ char *w, *state;
size_t l;
+ int r;
- if (read_one_line_file("/proc/cmdline", &line) < 0)
+ r = proc_cmdline(&line);
+ if (r < 0)
+ log_warning("Failed to read /proc/cmdline, ignoring: %s", strerror(-r));
+ if (r <= 0)
return;
FOREACH_WORD_QUOTED(w, l, line, state) {
free(s);
}
-
- free(line);
}
int main(int argc, char *argv[])