mirror of
https://github.com/systemd/systemd.git
synced 2025-01-04 23:53:42 +08:00
cgroup-show: don't hit assert, when the extra pids array is empty
This commit is contained in:
parent
57d8a552af
commit
3637713a20
Notes:
Lennart Poettering
2015-01-23 01:19:00 +01:00
Backport: bugfix
@ -43,7 +43,9 @@ static int compare(const void *a, const void *b) {
|
||||
static void show_pid_array(pid_t pids[], unsigned n_pids, const char *prefix, unsigned n_columns, bool extra, bool more, bool kernel_threads, OutputFlags flags) {
|
||||
unsigned i, j, pid_width;
|
||||
|
||||
assert(n_pids > 0);
|
||||
if (n_pids <= 0)
|
||||
return;
|
||||
|
||||
qsort(pids, n_pids, sizeof(pid_t), compare);
|
||||
|
||||
/* Filter duplicates */
|
||||
|
Loading…
Reference in New Issue
Block a user