summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2022-01-30 15:49:27 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-01-31 12:00:40 +0100
commit61b9769bda465f4832080e2a7a8285d247121d70 (patch)
tree443fd1041a27a4d58b24f6e6767a9c8cfee8bc56 /src
parentMerge pull request #21838 from lnussel/logind-refactor (diff)
downloadsystemd-61b9769bda465f4832080e2a7a8285d247121d70.tar.xz
systemd-61b9769bda465f4832080e2a7a8285d247121d70.zip
core: check argc/argv uncoditionally
as `assert()` might be dropped with `-DNDEBUG`. Follow-up to cf3095a and 1637e75.
Diffstat (limited to 'src')
-rw-r--r--src/core/main.c2
-rw-r--r--src/shared/main-func.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/core/main.c b/src/core/main.c
index fba9a4a8ec..f347b74b11 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -2726,7 +2726,7 @@ int main(int argc, char *argv[]) {
Manager *m = NULL;
FDSet *fds = NULL;
- assert(argc > 0 && !isempty(argv[0]));
+ assert_se(argc > 0 && !isempty(argv[0]));
/* SysV compatibility: redirect init → telinit */
redirect_telinit(argc, argv);
diff --git a/src/shared/main-func.h b/src/shared/main-func.h
index 09103bace9..81a5c1813c 100644
--- a/src/shared/main-func.h
+++ b/src/shared/main-func.h
@@ -15,7 +15,7 @@
#define _DEFINE_MAIN_FUNCTION(intro, impl, ret) \
int main(int argc, char *argv[]) { \
int r; \
- assert(argc > 0 && !isempty(argv[0])); \
+ assert_se(argc > 0 && !isempty(argv[0])); \
save_argc_argv(argc, argv); \
intro; \
r = impl; \