X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcgtop%2Fcgtop.c;h=5557094a4f8bfb3ba5678a9731eb4dfd57c61401;hb=b7def684941808600c344f0be7a2b9fcdda97e0f;hp=1fe247c667afae1f5b0a7687411af5d771a8fa19;hpb=dce818b390a857a11f7dd634684500675cf79833;p=elogind.git diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c index 1fe247c66..5557094a4 100644 --- a/src/cgtop/cgtop.c +++ b/src/cgtop/cgtop.c @@ -26,6 +26,7 @@ #include #include +#include "path-util.h" #include "util.h" #include "hashmap.h" #include "cgroup-util.h" @@ -53,7 +54,7 @@ typedef struct Group { uint64_t io_input_bps, io_output_bps; } Group; -static unsigned arg_depth = 2; +static unsigned arg_depth = 3; static usec_t arg_delay = 1*USEC_PER_SEC; static enum { @@ -309,7 +310,7 @@ static int refresh_one( if (r <= 0) goto finish; - p = join(path, "/", fn, NULL); + p = strjoin(path, "/", fn, NULL); free(fn); if (!p) { @@ -340,17 +341,22 @@ static int refresh(Hashmap *a, Hashmap *b, unsigned iteration) { r = refresh_one("name=systemd", "/", a, b, iteration, 0); if (r < 0) - return r; - + if (r != -ENOENT) + return r; r = refresh_one("cpuacct", "/", a, b, iteration, 0); if (r < 0) - return r; - + if (r != -ENOENT) + return r; r = refresh_one("memory", "/", a, b, iteration, 0); if (r < 0) - return r; + if (r != -ENOENT) + return r; - return refresh_one("blkio", "/", a, b, iteration, 0); + r = refresh_one("blkio", "/", a, b, iteration, 0); + if (r < 0) + if (r != -ENOENT) + return r; + return 0; } static int group_compare(const void*a, const void *b) {