chiark / gitweb /
libudev: list - use bit flags for 'sort' and 'unique'
[elogind.git] / udev / udev-event.c
index ef21ce8f6b1a5d774309226586fdbd49cf47c56b..e5683cfc2a4ba91262fecdf495807c0fe8dc462e 100644 (file)
@@ -660,7 +660,7 @@ static int spawn_wait(struct udev_event *event, const char *cmd, pid_t pid)
                        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);
                }
 
@@ -681,14 +681,20 @@ static int spawn_wait(struct udev_event *event, const char *cmd, pid_t pid)
                                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;
@@ -1069,7 +1075,7 @@ int udev_event_execute_run(struct udev_event *event, const sigset_t *sigmask)
                        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;
                        }
                }