summaryrefslogtreecommitdiff
path: root/src/shared/cgroup-show.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-05-16 17:44:57 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-05-22 10:16:00 +0200
commite3b4efd28f36a11a15531aa1a56ecadfd6f7253d (patch)
treedb6bee1c192cce630e2ddd393da860851783d78d /src/shared/cgroup-show.c
parent09c1dceef180630ecd6cf40e5c1fb653029b615c (diff)
downloadsystemd-e3b4efd28f36a11a15531aa1a56ecadfd6f7253d.tar.gz
Add 8bit-version of get_process_cmdline() and use in cgroup-show.c
This restores show_pid_array() output in legacy locales on the console. Only one call to get_process_cmdline() is changed, all others retain utf8-only mode. This affects systemd-cgls, systemctl status, etc, when working locally. Calls to get_process_cmdline() that cross a process boundary always use utf8. It's the callers responsibility to convert this to some encoding that they use. This means that we always pass utf8 over the bus.
Diffstat (limited to 'src/shared/cgroup-show.c')
-rw-r--r--src/shared/cgroup-show.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shared/cgroup-show.c b/src/shared/cgroup-show.c
index 464a3e5c03..e6fdcfa277 100644
--- a/src/shared/cgroup-show.c
+++ b/src/shared/cgroup-show.c
@@ -61,7 +61,9 @@ static void show_pid_array(
for (i = 0; i < n_pids; i++) {
_cleanup_free_ char *t = NULL;
- (void) get_process_cmdline(pids[i], n_columns, PROCESS_CMDLINE_COMM_FALLBACK, &t);
+ (void) get_process_cmdline(pids[i], n_columns,
+ PROCESS_CMDLINE_COMM_FALLBACK | PROCESS_CMDLINE_USE_LOCALE,
+ &t);
if (extra)
printf("%s%s ", prefix, special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET));