From: Benjamin Robin Date: Sun, 10 May 2020 16:38:08 +0000 (+0200) Subject: core: Update prototype of notify_message, tags list is read only X-Git-Tag: v246-rc1~374^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fcee2755ec1fa3f02fb722ace068b0801c0aea1f;p=thirdparty%2Fsystemd.git core: Update prototype of notify_message, tags list is read only Indicates that the tags list cannot be modified by notify_message function. Since the tags list is created only once for multiple call to notify_message functions. --- diff --git a/src/core/service.c b/src/core/service.c index b3c4ad73e5d..6e2a82a2865 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -3847,7 +3847,7 @@ static int service_dispatch_watchdog(sd_event_source *source, usec_t usec, void return 0; } -static bool service_notify_message_authorized(Service *s, pid_t pid, char **tags, FDSet *fds) { +static bool service_notify_message_authorized(Service *s, pid_t pid, FDSet *fds) { assert(s); if (s->notify_access == NOTIFY_NONE) { @@ -3894,19 +3894,19 @@ static void service_force_watchdog(Service *s) { static void service_notify_message( Unit *u, const struct ucred *ucred, - char **tags, + char * const *tags, FDSet *fds) { Service *s = SERVICE(u); bool notify_dbus = false; const char *e; - char **i; + char * const *i; int r; assert(u); assert(ucred); - if (!service_notify_message_authorized(SERVICE(u), ucred->pid, tags, fds)) + if (!service_notify_message_authorized(SERVICE(u), ucred->pid, fds)) return; if (DEBUG_LOGGING) { diff --git a/src/core/unit.h b/src/core/unit.h index a4c342a396a..4ad429bf309 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -539,7 +539,7 @@ typedef struct UnitVTable { void (*notify_cgroup_oom)(Unit *u); /* Called whenever a process of this unit sends us a message */ - void (*notify_message)(Unit *u, const struct ucred *ucred, char **tags, FDSet *fds); + void (*notify_message)(Unit *u, const struct ucred *ucred, char * const *tags, FDSet *fds); /* Called whenever a name this Unit registered for comes or goes away. */ void (*bus_name_owner_change)(Unit *u, const char *new_owner);