mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-08 20:58:20 +03:00
Merge pull request #10416 from poettering/udev-coverity
three simple coverity fixes
This commit is contained in:
commit
43d3c94e64
@ -3648,7 +3648,11 @@ static void service_notify_message(
|
||||
}
|
||||
if (r > 0) {
|
||||
service_set_main_pid(s, new_main_pid);
|
||||
unit_watch_pid(UNIT(s), new_main_pid);
|
||||
|
||||
r = unit_watch_pid(UNIT(s), new_main_pid);
|
||||
if (r < 0)
|
||||
log_unit_warning_errno(UNIT(s), r, "Failed to watch new main PID "PID_FMT" for service: %m", new_main_pid);
|
||||
|
||||
notify_dbus = true;
|
||||
}
|
||||
}
|
||||
|
@ -127,16 +127,16 @@ int udev_watch_end(sd_device *dev) {
|
||||
if (inotify_fd < 0)
|
||||
return log_error_errno(EINVAL, "Invalid inotify descriptor.");
|
||||
|
||||
r = sd_device_get_devname(dev, &devnode);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to get device name: %m");
|
||||
|
||||
r = device_get_watch_handle(dev, &wd);
|
||||
if (r == -ENOENT)
|
||||
return 0;
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to get watch handle for device '%s', ignoring: %m", devnode);
|
||||
|
||||
r = sd_device_get_devname(dev, &devnode);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to get device name: %m");
|
||||
|
||||
log_debug("Removing watch on '%s'", devnode);
|
||||
(void) inotify_rm_watch(inotify_fd, wd);
|
||||
|
||||
|
@ -555,7 +555,7 @@ static void event_run(Manager *manager, struct event *event) {
|
||||
if (count < 0) {
|
||||
log_error_errno(errno, "worker ["PID_FMT"] did not accept message %zi (%m), kill it",
|
||||
worker->pid, count);
|
||||
kill(worker->pid, SIGKILL);
|
||||
(void) kill(worker->pid, SIGKILL);
|
||||
worker->state = WORKER_KILLED;
|
||||
continue;
|
||||
}
|
||||
@ -629,7 +629,7 @@ static void manager_kill_workers(Manager *manager) {
|
||||
continue;
|
||||
|
||||
worker->state = WORKER_KILLED;
|
||||
kill(worker->pid, SIGTERM);
|
||||
(void) kill(worker->pid, SIGTERM);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user