projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
57d8a55
)
cgroup-show: don't hit assert, when the extra pids array is empty
author
Lennart Poettering
<lennart@poettering.net>
Thu, 22 Jan 2015 17:54:48 +0000
(18:54 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Thu, 22 Jan 2015 17:54:48 +0000
(18:54 +0100)
src/shared/cgroup-show.c
patch
|
blob
|
history
diff --git
a/src/shared/cgroup-show.c
b/src/shared/cgroup-show.c
index
1e14ba6
..
d113277
100644
(file)
--- a/
src/shared/cgroup-show.c
+++ b/
src/shared/cgroup-show.c
@@
-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 */