logind: rework allocation/freeing of inhibitors
authorLennart Poettering <lennart@poettering.net>
Tue, 23 Jul 2019 08:27:19 +0000 (10:27 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 23 Jul 2019 14:08:06 +0000 (16:08 +0200)
commit81280b2a6fbad079b5d72f48160bf1d492cc8e57
tree9ab6cdef248d27766a399f4e9c38bb1312e38399
parent09f300c4d0dbeb0aae98d30eb2214d4f425527e9
logind: rework allocation/freeing of inhibitors

Let's follow our modern style (i.e. return proper errors, use structure
initialization and _cleanup_).

Most importantly: remove state file and FIFO removal from
inhibitor_free() and let's move it to inhibitor_stop().

This makes sure that state files/FIFOs are not removed when the we
terminate logind, i.e. that they can survive logind restarts.

Fixes: #11825
src/login/logind-core.c
src/login/logind-inhibit.c
src/login/logind-inhibit.h