]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/manager.c
core: simplify the return convention in manager_load_unit()
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 17 Oct 2022 08:48:52 +0000 (10:48 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 17 Oct 2022 11:50:16 +0000 (13:50 +0200)
commit535b7fcb44f0a862e1707d0cb788afbbd20ee31e
treee0db677a712876fbab551186bf908d52dccc52e0
parent4b6a2b3f584bd06f6b0df450ec9d9d7ee537249c
core: simplify the return convention in manager_load_unit()

This function was returning 0 or 1 on success. It has many callers, and it
wasn't clear if any of them care about the distinction. It turns out they don't
and the return values were done for convenience because manager_load_unit_prepare()
returns 0 or 1. Let's invert the code in the static function to follow the usual
pattern where 0 means "no work was done" and 1 means "work was done", and make
the non-static function always return 0 to make the code easier to read, and
also add comments that explain what is happening.

No functional change.
src/core/manager.c