From: Mike Yuan Date: Fri, 1 Mar 2024 13:43:12 +0000 (+0800) Subject: core/service: rearrange variables, use ASSERT_PTR X-Git-Tag: v256-rc1~675^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7a22068ae9aee01807f981f693b561749923174;p=thirdparty%2Fsystemd.git core/service: rearrange variables, use ASSERT_PTR --- diff --git a/src/core/service.c b/src/core/service.c index 086404f6752..77531bbba92 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -4364,25 +4364,23 @@ static void service_notify_message( char * const *tags, FDSet *fds) { - Service *s = SERVICE(u); - bool notify_dbus = false; - usec_t monotonic_usec = USEC_INFINITY; - const char *e; + Service *s = ASSERT_PTR(SERVICE(u)); int r; - assert(u); assert(ucred); if (!service_notify_message_authorized(s, ucred->pid, fds)) return; if (DEBUG_LOGGING) { - _cleanup_free_ char *cc = NULL; - - cc = strv_join(tags, ", "); + _cleanup_free_ char *cc = strv_join(tags, ", "); log_unit_debug(u, "Got notification message from PID "PID_FMT" (%s)", ucred->pid, empty_to_na(cc)); } + usec_t monotonic_usec = USEC_INFINITY; + bool notify_dbus = false; + const char *e; + /* Interpret MAINPID= */ e = strv_find_startswith(tags, "MAINPID="); if (e && IN_SET(s->state, SERVICE_START, SERVICE_START_POST, SERVICE_RUNNING, SERVICE_RELOAD, SERVICE_RELOAD_SIGNAL, SERVICE_RELOAD_NOTIFY)) {