From: Lennart Poettering Date: Wed, 25 Dec 2013 18:00:12 +0000 (+0100) Subject: build-sys: minor fixes found with cppcheck X-Git-Tag: v209~645 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=43a99a7afe3063eebc901452026b13360b69a7b5;hp=25ad8664604507aacab593327b8d9d7454f0634d build-sys: minor fixes found with cppcheck --- diff --git a/Makefile.am b/Makefile.am index b7a468144..162a7be45 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5013,4 +5013,4 @@ tests += \ test-libudev-sym cppcheck: - cppcheck --enable=all $(top_srcdir) + cppcheck --enable=all -q $(top_srcdir) diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c index e5fc26235..c56f7a861 100644 --- a/src/cgtop/cgtop.c +++ b/src/cgtop/cgtop.c @@ -563,7 +563,7 @@ static int help(void) { " -d --delay=DELAY Delay between updates\n" " -n --iterations=N Run for N iterations before exiting\n" " -b --batch Run in batch mode, accepting no input\n" - " --depth=DEPTH Maximum traversal depth (default: %d)\n", + " --depth=DEPTH Maximum traversal depth (default: %u)\n", program_invocation_short_name, arg_depth); return 0; diff --git a/src/core/dbus-cgroup.c b/src/core/dbus-cgroup.c index 39865a96d..861bb1644 100644 --- a/src/core/dbus-cgroup.c +++ b/src/core/dbus-cgroup.c @@ -484,6 +484,8 @@ int bus_cgroup_set_property( n++; } + if (r < 0) + return r; if (mode != UNIT_CHECK) { _cleanup_free_ char *buf = NULL; diff --git a/src/core/execute.c b/src/core/execute.c index 9b33ec0ec..6ae9a5eb7 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -1974,7 +1974,7 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) { fprintf(f, "%sCPUAffinity:", prefix); for (i = 0; i < c->cpuset_ncpus; i++) if (CPU_ISSET_S(i, CPU_ALLOC_SIZE(c->cpuset_ncpus), c->cpuset)) - fprintf(f, " %i", i); + fprintf(f, " %u", i); fputs("\n", f); }