diff options
author | Michal Sekletar <msekleta@redhat.com> | 2019-05-31 18:02:20 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-06-03 15:21:52 +0200 |
commit | e7fca352ba43988682a927de6b1f629b3f10a415 (patch) | |
tree | e4c390c1962f21f8bfa00d143ade290de3e7ac99 /src/core | |
parent | 90e29fe1a5ceec8edd4a106332c05ca81fe1350e (diff) | |
download | systemd-e7fca352ba43988682a927de6b1f629b3f10a415.tar.gz |
execute: dump CPUAffinity as a range string instead of a list of CPUs
We do this already when printing the property in systemctl so be
consistent and do the same for systemd-analyze dump.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/execute.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/core/execute.c b/src/core/execute.c index 8d00534ae5..af994d97d1 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -4330,11 +4330,10 @@ void exec_context_dump(const ExecContext *c, FILE* f, const char *prefix) { } if (c->cpu_set.set) { - fprintf(f, "%sCPUAffinity:", prefix); - for (i = 0; i < c->cpu_set.allocated * 8; i++) - if (CPU_ISSET_S(i, c->cpu_set.allocated, c->cpu_set.set)) - fprintf(f, " %u", i); - fputs("\n", f); + _cleanup_free_ char *affinity = NULL; + + affinity = cpu_set_to_range_string(&c->cpu_set); + fprintf(f, "%sCPUAffinity: %s\n", prefix, affinity); } if (c->timer_slack_nsec != NSEC_INFINITY) |