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.
This commit is contained in:
Lennart Poettering
2019-03-21 18:10:06 +01:00
parent 36fea15565
commit 60ffa37a65
2 changed files with 2 additions and 3 deletions
+2
View File
@@ -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(); \