summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/journal/journald.c12
-rw-r--r--src/journal/sd-journal.h1
-rw-r--r--src/login/libsystemd-login.sym2
-rw-r--r--src/login/sd-login.c6
-rw-r--r--src/login/sd-login.h6
-rw-r--r--src/logs-show.c2
6 files changed, 14 insertions, 15 deletions
diff --git a/src/journal/journald.c b/src/journal/journald.c
index 47fe6edb0c..b029ab9781 100644
--- a/src/journal/journald.c
+++ b/src/journal/journald.c
@@ -431,7 +431,7 @@ static void dispatch_message_real(Server *s,
*comm = NULL, *cmdline = NULL, *hostname = NULL,
*audit_session = NULL, *audit_loginuid = NULL,
*exe = NULL, *cgroup = NULL, *session = NULL,
- *owner_uid = NULL, *service = NULL;
+ *owner_uid = NULL, *unit = NULL;
char idbuf[33];
sd_id128_t id;
@@ -515,12 +515,12 @@ static void dispatch_message_real(Server *s,
IOVEC_SET_STRING(iovec[n++], session);
}
- if (sd_pid_get_service(ucred->pid, &t) >= 0) {
- service = strappend("_SYSTEMD_SERVICE=", t);
+ if (sd_pid_get_unit(ucred->pid, &t) >= 0) {
+ unit = strappend("_SYSTEMD_UNIT=", t);
free(t);
- if (service)
- IOVEC_SET_STRING(iovec[n++], service);
+ if (unit)
+ IOVEC_SET_STRING(iovec[n++], unit);
}
if (sd_pid_get_owner_uid(ucred->uid, &owner) >= 0)
@@ -596,7 +596,7 @@ retry:
free(cgroup);
free(session);
free(owner_uid);
- free(service);
+ free(unit);
}
static void dispatch_message(Server *s,
diff --git a/src/journal/sd-journal.h b/src/journal/sd-journal.h
index d7e2528a35..87da17ddc6 100644
--- a/src/journal/sd-journal.h
+++ b/src/journal/sd-journal.h
@@ -35,7 +35,6 @@
* - OR of matches is borked...
* - extend hash tables table as we go
* - accelerate looking for "all hostnames" and suchlike.
- * - hookup with systemctl
* - handle incomplete header
*
* - local deserializer
diff --git a/src/login/libsystemd-login.sym b/src/login/libsystemd-login.sym
index bac46f4064..15e505e83b 100644
--- a/src/login/libsystemd-login.sym
+++ b/src/login/libsystemd-login.sym
@@ -36,5 +36,5 @@ local:
LIBSYSTEMD_LOGIN_38 {
global:
- sd_pid_get_service;
+ sd_pid_get_unit;
} LIBSYSTEMD_LOGIN_31;
diff --git a/src/login/sd-login.c b/src/login/sd-login.c
index e857ae08d2..8893b1de80 100644
--- a/src/login/sd-login.c
+++ b/src/login/sd-login.c
@@ -121,11 +121,11 @@ _public_ int sd_pid_get_session(pid_t pid, char **session) {
return 0;
}
-_public_ int sd_pid_get_service(pid_t pid, char **service) {
+_public_ int sd_pid_get_unit(pid_t pid, char **unit) {
int r;
char *cgroup, *p;
- if (!service)
+ if (!unit)
return -EINVAL;
r = pid_get_cgroup(pid, NULL, &cgroup);
@@ -144,7 +144,7 @@ _public_ int sd_pid_get_service(pid_t pid, char **service) {
if (!p)
return -ENOMEM;
- *service = p;
+ *unit = p;
return 0;
}
diff --git a/src/login/sd-login.h b/src/login/sd-login.h
index 1d8a55e906..00de6716b0 100644
--- a/src/login/sd-login.h
+++ b/src/login/sd-login.h
@@ -53,9 +53,9 @@ int sd_pid_get_session(pid_t pid, char **session);
* return an error for system processes. */
int sd_pid_get_owner_uid(pid_t pid, uid_t *uid);
-/* Get service name from PID. This will return an error for
- * non-service processes. */
-int sd_pid_get_service(pid_t, char **service);
+/* Get systemd unit (i.e. service) name from PID. This will return an
+ * error for non-service processes. */
+int sd_pid_get_unit(pid_t, char **unit);
/* Get state from uid. Possible states: offline, lingering, online, active */
int sd_uid_get_state(uid_t uid, char**state);
diff --git a/src/logs-show.c b/src/logs-show.c
index d178f95f94..e28fe8fa21 100644
--- a/src/logs-show.c
+++ b/src/logs-show.c
@@ -359,7 +359,7 @@ int show_journal_by_service(
if (!prefix)
prefix = "";
- if (asprintf(&m, "_SYSTEMD_SERVICE=%s", service) < 0) {
+ if (asprintf(&m, "_SYSTEMD_UNIT=%s", service) < 0) {
r = -ENOMEM;
goto finish;
}