summaryrefslogtreecommitdiffstats
path: root/src/analyze/analyze-exit-status.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-05-17 16:25:06 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-05-19 08:02:29 +0200
commitfddad5f4a66a68682892e3fa7f22ec2689786d33 (patch)
treedfd8b2ff5409ef8cf24f4d8b8e5d4de8236bc4ef /src/analyze/analyze-exit-status.c
parentanalyze: use automatic cleanup in one more place (diff)
downloadsystemd-fddad5f4a66a68682892e3fa7f22ec2689786d33.tar.xz
systemd-fddad5f4a66a68682892e3fa7f22ec2689786d33.zip
analyze: allow verbs to return positive failure
No functional change is intended. The verbs where it wasn't immediately clear if the success exit status is 0 or >= 0 are changed to explicitly return 0. (I think it's better to be explicit than to rely on some call stack always returning 0 on success.) Some other functions are cleaned up to be more idiomatic.
Diffstat (limited to 'src/analyze/analyze-exit-status.c')
-rw-r--r--src/analyze/analyze-exit-status.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/analyze/analyze-exit-status.c b/src/analyze/analyze-exit-status.c
index a3f21c60ea..3a8d3f4b2a 100644
--- a/src/analyze/analyze-exit-status.c
+++ b/src/analyze/analyze-exit-status.c
@@ -48,5 +48,9 @@ int verb_exit_status(int argc, char *argv[], void *userdata) {
pager_open(arg_pager_flags);
- return table_print(table, NULL);
+ r = table_print(table, NULL);
+ if (r < 0)
+ return r;
+
+ return EXIT_SUCCESS;
}