summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaphael Ning <raphning@amazon.com>2021-03-23 17:45:02 +0000
committerSimon Horman <horms@verge.net.au>2021-04-02 11:59:33 +0200
commit2c30aa5c704901e5d5dcbe958a45a0b44948fdc7 (patch)
treec711726627ca014130149333492c7934e115270f
parent82f7de2724c42a6aecc0cff93881b3dfd09363ce (diff)
downloadkexec-tools-2c30aa5c704901e5d5dcbe958a45a0b44948fdc7.tar.gz
kexec: Fix description of --status exit code
On both Linux and Xen, an exit code of 0 from `kexec --status` indicates that the kexec image being queried is NOT loaded, which is contrary to what the man page and usage() say. Signed-off-by: Raphael Ning <raphning@amazon.com> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--kexec/kexec.86
-rw-r--r--kexec/kexec.c3
2 files changed, 5 insertions, 4 deletions
diff --git a/kexec/kexec.8 b/kexec/kexec.8
index 25807258..3ebede67 100644
--- a/kexec/kexec.8
+++ b/kexec/kexec.8
@@ -108,9 +108,9 @@ command:
Enable debugging messages.
.TP
.B \-S\ (\-\-status)
-Return 0 if the type (by default crash) is loaded. Can be used in conjuction
-with -l or -p to toggle the type. Note this option supersedes other options
-and it will
+Return 1 if the type (by default crash) is loaded, 0 if not. Can be used in
+conjuction with -l or -p to toggle the type. Note this option supersedes other
+options and it will
.BR not\ load\ or\ unload\ the\ kernel.
.TP
.B \-e\ (\-\-exec)
diff --git a/kexec/kexec.c b/kexec/kexec.c
index c5a8dec1..b4431ef1 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -1040,7 +1040,8 @@ void usage(void)
" syscall is not supported or the kernel did not\n"
" understand the image\n"
" -d, --debug Enable debugging to help spot a failure.\n"
- " -S, --status Return 0 if the type (by default crash) is loaded.\n"
+ " -S, --status Return 1 if the type (by default crash) is loaded,\n"
+ " 0 if not.\n"
"\n"
"Supported kernel file types and options: \n");
for (i = 0; i < file_types; i++) {