[systemd-commits] src/shared

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Thu Jan 22 17:09:37 PST 2015


 src/shared/cgroup-show.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit da41abc52ca1f5965a22cc481a720328b987b335
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Thu Jan 22 20:03:58 2015 -0500

    cgroup-show: remove duplicated check
    
    After 3637713a20 it is not necessary anymore.

diff --git a/src/shared/cgroup-show.c b/src/shared/cgroup-show.c
index d113277..ea66c76 100644
--- a/src/shared/cgroup-show.c
+++ b/src/shared/cgroup-show.c
@@ -43,7 +43,7 @@ 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;
 
-        if (n_pids <= 0)
+        if (n_pids == 0)
                 return;
 
         qsort(pids, n_pids, sizeof(pid_t), compare);
@@ -113,8 +113,7 @@ static int show_cgroup_one_by_path(const char *path, const char *prefix, unsigne
         if (r < 0)
                 return r;
 
-        if (n > 0)
-                show_pid_array(pids, n, prefix, n_columns, false, more, kernel_threads, flags);
+        show_pid_array(pids, n, prefix, n_columns, false, more, kernel_threads, flags);
 
         return 0;
 }



More information about the systemd-commits mailing list