|
Zbigniew Jędrzejewski-Szmek |
5d6eed |
From 045473ceb4999997f44fd1e4e1a3e5530b6fb828 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
From: Martin Pitt <martin.pitt@ubuntu.com>
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
Date: Tue, 8 Nov 2016 05:31:55 +0100
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
Subject: [PATCH] nspawn: fix exit code for --help and --version (#4609)
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
Commit b006762 inverted the initial exit code which is relevant for --help and
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
--version without a particular reason. For these special options, parse_argv()
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
returns 0 so that our main() immediately skips to the end without adjusting
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
"ret". Otherwise, if an actual container is being started, ret is set on error
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
in run(), which still provides the "non-zero exit on error" behaviour.
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
Fixes #4605.
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
(cherry picked from commit cfed63f60dd7412c199652825ed172c319b02b3c)
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
---
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
src/nspawn/nspawn.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
index c56af6e6f4..c8fc011907 100644
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
--- a/src/nspawn/nspawn.c
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
+++ b/src/nspawn/nspawn.c
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
@@ -4033,7 +4033,7 @@ int main(int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
bool root_device_rw = true, home_device_rw = true, srv_device_rw = true;
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
_cleanup_close_ int master = -1, image_fd = -1;
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
_cleanup_fdset_free_ FDSet *fds = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
- int r, n_fd_passed, loop_nr = -1, ret = EXIT_FAILURE;
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
+ int r, n_fd_passed, loop_nr = -1, ret = EXIT_SUCCESS;
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
char veth_name[IFNAMSIZ] = "";
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
bool secondary = false, remove_subvol = false;
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
pid_t pid = 0;
|