Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Raphael Ning <raphning@gmail.com>
To: Simon Horman <horms@verge.net.au>
Cc: kexec@lists.infradead.org, Julien Grall <julien@xen.org>,
	Hongyan Xia <hx242@xen.org>, Raphael Ning <raphning@amazon.com>
Subject: [PATCH] kexec: Fix description of --status exit code
Date: Tue, 23 Mar 2021 17:45:02 +0000	[thread overview]
Message-ID: <20210323174502.32673-1-raphning@gmail.com> (raw)

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

             reply	other threads:[~2021-03-23 17:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23 17:45 Raphael Ning [this message]
2021-04-02 10:00 ` [PATCH] kexec: Fix description of --status exit code Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210323174502.32673-1-raphning@gmail.com \
    --to=raphning@gmail.com \
    --cc=horms@verge.net.au \
    --cc=hx242@xen.org \
    --cc=julien@xen.org \
    --cc=kexec@lists.infradead.org \
    --cc=raphning@amazon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox