diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-11-20 14:03:46 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-11-20 16:48:21 +0100 |
commit | a34c79d0067b79cc27748f70092861ddd942a039 (patch) | |
tree | 07b0182e1ec5d6dacb3542f28c76a6ef5ee389ae /src/login/inhibit.c | |
parent | ec5e5948315c856077861b06162ffbc4a83c5b79 (diff) | |
download | systemd-a34c79d0067b79cc27748f70092861ddd942a039.tar.gz |
basic/main-func: also close the pager automatically
We generally want to close the pager last. This patch closes the pager last,
after the static destuctor calls. This means that they can do logging and such
like during normal program runtime.
Diffstat (limited to 'src/login/inhibit.c')
-rw-r--r-- | src/login/inhibit.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/login/inhibit.c b/src/login/inhibit.c index 5c0637c861..7a63eb6efc 100644 --- a/src/login/inhibit.c +++ b/src/login/inhibit.c @@ -282,12 +282,10 @@ static int run(int argc, char *argv[]) { if (r < 0) return log_error_errno(r, "Failed to connect to bus: %m"); - if (arg_action == ACTION_LIST) { - r = print_inhibitors(bus); - pager_close(); - return r; + if (arg_action == ACTION_LIST) + return print_inhibitors(bus); - } else { + else { _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_close_ int fd = -1; _cleanup_free_ char *w = NULL; |