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.
This commit is contained in:
Benjamin Robin
2020-05-10 18:58:03 +02:00
parent 147d8fc1a7
commit fcee2755ec
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -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) {
+1 -1
View File
@@ -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);