* [PATCH] kexec: Fix description of --status exit code
@ 2021-03-23 17:45 Raphael Ning
2021-04-02 10:00 ` Simon Horman
0 siblings, 1 reply; 2+ messages in thread
From: Raphael Ning @ 2021-03-23 17:45 UTC (permalink / raw)
To: Simon Horman; +Cc: kexec, Julien Grall, Hongyan Xia, Raphael Ning
From: Raphael Ning <raphning@amazon.com>
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>
---
kexec/kexec.8 | 6 +++---
kexec/kexec.c | 3 ++-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/kexec/kexec.8 b/kexec/kexec.8
index 258072587cd0..3ebede67388e 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 fd7c8d2b7a79..ffc689ac3d7f 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++) {
--
2.23.3
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] kexec: Fix description of --status exit code
2021-03-23 17:45 [PATCH] kexec: Fix description of --status exit code Raphael Ning
@ 2021-04-02 10:00 ` Simon Horman
0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2021-04-02 10:00 UTC (permalink / raw)
To: Raphael Ning; +Cc: kexec, Julien Grall, Hongyan Xia, Raphael Ning
On Tue, Mar 23, 2021 at 05:45:02PM +0000, Raphael Ning wrote:
> From: Raphael Ning <raphning@amazon.com>
>
> 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>
Thanks, applied.
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-02 10:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23 17:45 [PATCH] kexec: Fix description of --status exit code Raphael Ning
2021-04-02 10:00 ` Simon Horman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.