]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/cgroup.c
util-lib: introduce new empty_or_root() helper (#8746)
authorLennart Poettering <lennart@poettering.net>
Wed, 18 Apr 2018 12:20:49 +0000 (14:20 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 18 Apr 2018 12:20:49 +0000 (14:20 +0200)
commit57ea45e11a3856a110cf195628f8b26cfe019a15
tree900a35ca836367027c812d0829bf7cf2f508e9b1
parent12777909c9cbf4217aecbbb38de97bac5252fc5b
util-lib: introduce new empty_or_root() helper (#8746)

We check the same condition at various places. Let's add a trivial,
common helper for this, and use it everywhere.

It's not going to make things much faster or much shorter, but I think a
lot more readable
coccinelle/empty-or-root.cocci [new file with mode: 0644]
src/basic/cgroup-util.c
src/basic/fs-util.c
src/basic/path-util.c
src/basic/path-util.h
src/basic/unit-name.c
src/basic/user-util.c
src/cgtop/cgtop.c
src/core/cgroup.c
src/shared/path-lookup.c
src/test/test-path-util.c