Skip to contentSkip to conversation

kexec: Fix description of --status exit code

PATCH Applied Raphael Ning 2 participants 2 messages Mar 23, 2021 – Apr 2, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kexec: Fix description of --status exit code

From: Raphael Ning <[email protected]>

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.

---
 kexec/kexec.8 | 6 +++---
 kexec/kexec.c | 3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)
kexec/kexec.8 +3 -3
index 258072587cd0..3ebede67388e 100644
@@ -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)
kexec/kexec.c +2 -1
index fd7c8d2b7a79..ffc689ac3d7f 100644
@@ -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++) {
Signature · 7 lines
2.23.3


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec