summaryrefslogtreecommitdiffstats
path: root/src/shared/main-func.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-03-15 14:49:43 +0100
committerLennart Poettering <lennart@poettering.net>2019-03-21 18:10:06 +0100
commit60ffa37a65a96c3af857a3dfc4a6fd47b20cc90e (patch)
treed458631af11958dd74b89167da1d4c6f967a37bd /src/shared/main-func.h
parentutil: introduce save_argc_argv() helper (diff)
downloadsystemd-60ffa37a65a96c3af857a3dfc4a6fd47b20cc90e.tar.xz
systemd-60ffa37a65a96c3af857a3dfc4a6fd47b20cc90e.zip
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.
Diffstat (limited to 'src/shared/main-func.h')
-rw-r--r--src/shared/main-func.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/shared/main-func.h b/src/shared/main-func.h
index 3c182e802b..486976f65e 100644
--- a/src/shared/main-func.h
+++ b/src/shared/main-func.h
@@ -8,10 +8,12 @@
#include "spawn-ask-password-agent.h"
#include "spawn-polkit-agent.h"
#include "static-destruct.h"
+#include "util.h"
#define _DEFINE_MAIN_FUNCTION(intro, impl, ret) \
int main(int argc, char *argv[]) { \
int r; \
+ save_argc_argv(argc, argv); \
intro; \
r = impl; \
static_destruct(); \