goto out;
}
if (fdcount == 0) {
- err(udev, "timeout: killing '%s'[%u]\n", cmd, pid);
+ err(udev, "timeout: killing '%s' [%u]\n", cmd, pid);
kill(pid, SIGKILL);
}
if (waitpid(pid, &status, WNOHANG) < 0)
break;
if (WIFEXITED(status)) {
- info(udev, "'%s'[%u] returned with exitcode %i\n", cmd, pid, WEXITSTATUS(status));
+ info(udev, "'%s' [%u] exit with return code %i\n", cmd, pid, WEXITSTATUS(status));
if (WEXITSTATUS(status) != 0)
err = -1;
} else if (WIFSIGNALED(status)) {
- err(udev, "'%s'[%u] terminated by signal %i\n", cmd, pid, WTERMSIG(status));
+ err(udev, "'%s' [%u] terminated by signal %i (%s)\n", cmd, pid, WTERMSIG(status), strsignal(WTERMSIG(status)));
+ err = -1;
+ } else if (WIFSTOPPED(status)) {
+ err(udev, "'%s' [%u] stopped\n", cmd, pid);
+ err = -1;
+ } else if (WIFCONTINUED(status)) {
+ err(udev, "'%s' [%u] continued\n", cmd, pid);
err = -1;
} else {
- err(udev, "'%s'[%u] unexpected exit with status 0x%04x\n", cmd, pid, status);
+ err(udev, "'%s' [%u] exit with status 0x%04x\n", cmd, pid, status);
err = -1;
}
pid = 0;
udev_event_apply_format(event, cmd, program, sizeof(program));
envp = udev_device_get_properties_envp(event->dev);
if (udev_event_spawn(event, program, envp, sigmask, NULL, 0) < 0) {
- if (udev_list_entry_get_flags(list_entry))
+ if (udev_list_entry_get_num(list_entry))
err = -1;
}
}