]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev-manager: use notify_start() and notify_on_cleanup()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 24 Mar 2025 11:01:48 +0000 (20:01 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 31 Mar 2025 18:34:41 +0000 (03:34 +0900)
No functional change. Just refactoring.

src/udev/udev-manager.c

index adfe8540b21c7f5c55f21bd6eaf67f5526680a57..415112eae414190eaaf0a16c4576af18bdac493c 100644 (file)
@@ -1373,12 +1373,12 @@ int manager_main(Manager *manager) {
         if (r < 0)
                 log_warning_errno(r, "Failed to apply permissions on static device nodes, ignoring: %m");
 
-        notify_ready(manager);
+        _unused_ _cleanup_(notify_on_cleanup) const char *notify_message =
+                notify_start(NOTIFY_READY, NOTIFY_STOPPING);
 
         r = sd_event_loop(manager->event);
         if (r < 0)
-                log_error_errno(r, "Event loop failed: %m");
+                return log_error_errno(r, "Event loop failed: %m");
 
-        (void) sd_notify(/* unset= */ false, NOTIFY_STOPPING);
-        return r;
+        return 0;
 }