Commit Graph

10 Commits

Author SHA1 Message Date
Yu Watanabe db9ecf0501 license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
Lennart Poettering 6b636c2d27 main-func: send main exit code to parent via sd_notify() on exit
So far we silently convert negative return values from run() as
EXIT_FAILURE, which is how UNIX expects it. In many cases it would be
very useful for the caller to retrieve the actual error number we exit
with. Let's generically return that via sd_notify()'s ERRNO= attribute.
This means callers can set $NOTIFY_SOCKET and get the actual error
number delivered at their doorstep just like that.
2019-12-04 10:59:59 +01:00
Ben Boeckel 5238e95759 codespell: fix spelling errors 2019-04-29 16:47:18 +02:00
Lennart Poettering a0c6f3cb66 main-func: make sure we destruct memory and stuff last
Let's terminate pagers and agents before releasing all memory.
2019-03-21 18:10:06 +01:00
Lennart Poettering 60ffa37a65 main-func: implicitly save argc/argv in DEFINE_MAIN_FUNCTION() functions
Let's remove the risk of forgetting to save argc/argv if
DEFINE_MAIN_FUNCTION() is used.
2019-03-21 18:10:06 +01:00
Zbigniew Jędrzejewski-Szmek 7a44c7e31f generators: define custom main func definer and use it where applicable
There should be no functional difference, except that the error message
is changd from "three or no arguments" to "zero or three arguments". Somehow
the inverted form always seemed strange.

umask() call is also dropped from run-generator. I think it wasn't dropped in
053254e3cb because the run generator was merged
around the same time.
2018-12-12 21:58:00 +01:00
Zbigniew Jędrzejewski-Szmek 8d38b8ad56 Call mac_selinux_close() from main func macros, convert user-sessions and test-udev 2018-11-21 09:14:00 +01:00
Zbigniew Jędrzejewski-Szmek d1405af399 systemctl: define main through macro and call ask_password_agent_close() from the macro
This doesn't save us anything, but I like consistency.
2018-11-21 09:14:00 +01:00
Zbigniew Jędrzejewski-Szmek a6db316372 shared/main-func: also close the polkit agent automatically
The agent is closed after the static destuctors but before the pager.
No users of DEFINE_MAIN_FUNCTION* were using a polkit agent, so this makes no
functional difference.
2018-11-20 18:40:02 +01:00
Zbigniew Jędrzejewski-Szmek 294bf0c34a Split out pretty-print.c and move pager.c and main-func.h to shared/
This is high-level functionality, and fits better in shared/ (which is for
our executables), than in basic/ (which is also for libraries).
2018-11-20 18:40:02 +01:00
Renamed from src/basic/main-func.h (Browse further)