From: Zbigniew Jędrzejewski-Szmek Date: Tue, 8 Jan 2019 21:56:50 +0000 (+0100) Subject: udevd: drop redundant call to sd_event_get_exit_code X-Git-Tag: archive/raspbian/240-4+rpi1^2~27 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4bb8fab6ab226a68c7b5375d67bef8ce02c6b99f;p=systemd.git udevd: drop redundant call to sd_event_get_exit_code sd_event_loop returns the same thing anyway. (cherry picked from commit 44dcf454b604628bf451194482c97ce981596ce5) (cherry picked from commit 1f6562d559bd11612b3f59b20fae4ed34d688dff) Gbp-Pq: Name udevd-drop-redundant-call-to-sd_event_get_exit_code.patch --- diff --git a/src/udev/udevd.c b/src/udev/udevd.c index ec77bd4a..6938d81a 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -464,7 +464,7 @@ static int worker_device_monitor_handler(sd_device_monitor *monitor, sd_device * static int worker_main(Manager *_manager, sd_device_monitor *monitor, sd_device *first_device) { _cleanup_(sd_device_unrefp) sd_device *dev = first_device; _cleanup_(manager_freep) Manager *manager = _manager; - int r, ret; + int r; assert(manager); assert(monitor); @@ -507,11 +507,7 @@ static int worker_main(Manager *_manager, sd_device_monitor *monitor, sd_device if (r < 0) return log_error_errno(r, "Event loop failed: %m"); - r = sd_event_get_exit_code(manager->event, &ret); - if (r < 0) - return log_error_errno(r, "Failed to get exit code: %m"); - - return ret; + return 0; } static int worker_spawn(Manager *manager, struct event *event) { @@ -1737,14 +1733,9 @@ static int main_loop(int fd_ctrl, int fd_uevent, const char *cgroup) { "STATUS=Processing with %u children at max", arg_children_max); r = sd_event_loop(manager->event); - if (r < 0) { + if (r < 0) log_error_errno(r, "Event loop failed: %m"); - goto exit; - } - - sd_event_get_exit_code(manager->event, &r); -exit: sd_notify(false, "STOPPING=1\n" "STATUS=Shutting down...");