]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/service: remove unused function param and minor cleanup 31567/head
authorMike Yuan <me@yhndnzj.com>
Fri, 1 Mar 2024 13:48:23 +0000 (21:48 +0800)
committerMike Yuan <me@yhndnzj.com>
Fri, 1 Mar 2024 13:56:43 +0000 (21:56 +0800)
src/core/service.c

index 77531bbba92021ab6e7e294a107f832bcdad691f..9ba2e09a8111867c5b45ecbc689f06cdc1a04f1e 100644 (file)
@@ -4321,14 +4321,15 @@ static void service_force_watchdog(Service *s) {
         service_enter_signal(s, SERVICE_STOP_WATCHDOG, SERVICE_FAILURE_WATCHDOG);
 }
 
-static bool service_notify_message_authorized(Service *s, pid_t pid, FDSet *fds) {
+static bool service_notify_message_authorized(Service *s, pid_t pid) {
         assert(s);
+        assert(pid_is_valid(pid));
 
         NotifyAccess notify_access = service_get_notify_access(s);
 
         if (notify_access == NOTIFY_NONE) {
                 /* Warn level only if no notifications are expected */
-                log_unit_warning(UNIT(s), "Got notification message from PID "PID_FMT", but reception is disabled.", pid);
+                log_unit_warning(UNIT(s), "Got notification message from PID "PID_FMT", but reception is disabled", pid);
                 return false;
         }
 
@@ -4344,7 +4345,7 @@ static bool service_notify_message_authorized(Service *s, pid_t pid, FDSet *fds)
         if (notify_access == NOTIFY_EXEC && pid != s->main_pid.pid && pid != s->control_pid.pid) {
                 if (pidref_is_set(&s->main_pid) && pidref_is_set(&s->control_pid))
                         log_unit_debug(UNIT(s), "Got notification message from PID "PID_FMT", but reception only permitted for main PID "PID_FMT" and control PID "PID_FMT,
-                                         pid, s->main_pid.pid, s->control_pid.pid);
+                                       pid, s->main_pid.pid, s->control_pid.pid);
                 else if (pidref_is_set(&s->main_pid))
                         log_unit_debug(UNIT(s), "Got notification message from PID "PID_FMT", but reception only permitted for main PID "PID_FMT, pid, s->main_pid.pid);
                 else if (pidref_is_set(&s->control_pid))
@@ -4369,7 +4370,7 @@ static void service_notify_message(
 
         assert(ucred);
 
-        if (!service_notify_message_authorized(s, ucred->pid, fds))
+        if (!service_notify_message_authorized(s, ucred->pid))
                 return;
 
         if (DEBUG_LOGGING) {