summaryrefslogtreecommitdiffstats
path: root/src/portable
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-01-09 12:43:41 +0100
committerMike Yuan <me@yhndnzj.com>2024-01-09 14:57:45 +0100
commitf359b3073fab8978b1b1a85133d6506c5403d39f (patch)
treefaa3370c4b2a1a52de11b556c23045c421a65da1 /src/portable
parentMerge pull request #30843 from keszybz/test-relative-paths (diff)
downloadsystemd-f359b3073fab8978b1b1a85133d6506c5403d39f.tar.xz
systemd-f359b3073fab8978b1b1a85133d6506c5403d39f.zip
machined,portabled: remove unneeded NOTIFY_STOPPING
This is done internally by bus_event_loop_with_idle().
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/portabled.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/portable/portabled.c b/src/portable/portabled.c
index 7c2ddd90ef..d4a01fa53b 100644
--- a/src/portable/portabled.c
+++ b/src/portable/portabled.c
@@ -122,17 +122,6 @@ static bool check_idle(void *userdata) {
return !m->operations;
}
-static int manager_run(Manager *m) {
- assert(m);
-
- return bus_event_loop_with_idle(
- m->event,
- m->bus,
- "org.freedesktop.portable1",
- DEFAULT_EXIT_USEC,
- check_idle, m);
-}
-
static int run(int argc, char *argv[]) {
_cleanup_(manager_unrefp) Manager *m = NULL;
int r;
@@ -162,16 +151,20 @@ static int run(int argc, char *argv[]) {
if (r < 0)
return log_error_errno(r, "Failed to fully start up daemon: %m");
- log_debug("systemd-portabled running as pid " PID_FMT, getpid_cached());
r = sd_notify(false, NOTIFY_READY);
if (r < 0)
log_warning_errno(r, "Failed to send readiness notification, ignoring: %m");
- r = manager_run(m);
+ r = bus_event_loop_with_idle(
+ m->event,
+ m->bus,
+ "org.freedesktop.portable1",
+ DEFAULT_EXIT_USEC,
+ check_idle, m);
+ if (r < 0)
+ return log_error_errno(r, "Failed to run main loop: %m");
- (void) sd_notify(false, NOTIFY_STOPPING);
- log_debug("systemd-portabled stopped as pid " PID_FMT, getpid_cached());
- return r;
+ return 0;
}
DEFINE_MAIN_FUNCTION(run);