]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/manager.c
manager: always close idle pipe when sending ready notification
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 29 Dec 2021 03:04:46 +0000 (12:04 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 29 Dec 2021 12:35:48 +0000 (12:35 +0000)
commit9c1b17c3dc1541df02118ee3aaf6dd5dd540cdc2
tree5f1bf5dd95b2f70fe0ee74f5ee78aa808a99cb36
parent5204355861643a658a6d8e009b67e422cdb9194b
manager: always close idle pipe when sending ready notification

This fixes a bug introduced by 6d9326595592f98e8126eacb4176acd8c3516d5c.

The commit makes several functions skipped if the manager is already
in finished state, as
> In manager_check_finished(), more steps are skipped if MANAGER_IS_FINISHED().
> Those steps are idempotent, but no need to waste cycles trying to do them
> more than once.

However, the idle pipe may be re-opened after manager is finished:
manager_dispatch_run_queue() -> manager_watch_idle_pipe().
So, the closing the pipe is not idempotent here.

Fixes #21889.
src/core/manager.c