util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ruediger Meier <sweet_f_a@gmx.de>
To: util-linux@vger.kernel.org
Subject: [PATCH 03/13] misc: fix some broken exit codes
Date: Thu, 22 Jun 2017 04:37:36 +0200	[thread overview]
Message-ID: <1498099066-24235-4-git-send-email-sweet_f_a@gmx.de> (raw)
In-Reply-To: <1498099066-24235-1-git-send-email-sweet_f_a@gmx.de>

From: Ruediger Meier <ruediger.meier@ga-group.nl>

These tools have special exit codes. They got changed mistakenly.

See:
  findfs       0e1fa6b6
  fsck         658c0891
  fsck.cramfs  922ec175
  mkfs.cramfs  16154b1f

FIXME: STRTOXX_EXIT_CODE doesn't work as it should.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
---
 disk-utils/fsck.c        | 2 +-
 disk-utils/fsck.cramfs.c | 2 +-
 disk-utils/mkfs.cramfs.c | 2 +-
 misc-utils/findfs.c      | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/disk-utils/fsck.c b/disk-utils/fsck.c
index cb1b212..5a418fc 100644
--- a/disk-utils/fsck.c
+++ b/disk-utils/fsck.c
@@ -55,7 +55,7 @@
 #include "fileutils.h"
 #include "monotonic.h"
 
-#define STRTOXX_EXIT_CODE	FSCK_EX_ERROR
+#define STRTOXX_EXIT_CODE	FSCK_EX_USAGE
 #include "strutils.h"
 
 #define XALLOC_EXIT_CODE	FSCK_EX_ERROR
diff --git a/disk-utils/fsck.cramfs.c b/disk-utils/fsck.cramfs.c
index 63033d6..952f153 100644
--- a/disk-utils/fsck.cramfs.c
+++ b/disk-utils/fsck.cramfs.c
@@ -671,7 +671,7 @@ int main(int argc, char **argv)
 			break;
 		case 'V':
 			printf(UTIL_LINUX_VERSION);
-			return EXIT_SUCCESS;
+			return FSCK_EX_OK;
 		case 'x':
 			opt_extract = 1;
 			if(optarg)
diff --git a/disk-utils/mkfs.cramfs.c b/disk-utils/mkfs.cramfs.c
index 77b4467..041c6d7 100644
--- a/disk-utils/mkfs.cramfs.c
+++ b/disk-utils/mkfs.cramfs.c
@@ -910,5 +910,5 @@ int main(int argc, char **argv)
 	    (warn_namelen|warn_skip|warn_size|warn_uid|warn_gid|warn_dev))
 		exit(MKFS_EX_ERROR);
 
-	return EXIT_SUCCESS;
+	return MKFS_EX_OK;
 }
diff --git a/misc-utils/findfs.c b/misc-utils/findfs.c
index 7935232..7d2d803 100644
--- a/misc-utils/findfs.c
+++ b/misc-utils/findfs.c
@@ -63,11 +63,11 @@ int main(int argc, char **argv)
 		switch (c) {
 		case 'V':
 			printf(UTIL_LINUX_VERSION);
-			return EXIT_SUCCESS;
+			return FINDFS_SUCCESS;
 		case 'h':
 			usage(FINDFS_SUCCESS);
 		default:
-			errtryhelp(EXIT_FAILURE);
+			errtryhelp(FINDFS_USAGE_ERROR);
 		}
 
 	dev = blkid_evaluate_tag(argv[1], NULL, NULL);
-- 
1.8.5.6


  parent reply	other threads:[~2017-06-22  2:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-22  2:37 [PATCH 00/13] usage cleanup part 1 Ruediger Meier
2017-06-22  2:37 ` [PATCH 01/13] uuidd: remove unused define Ruediger Meier
2017-06-22  2:37 ` [PATCH 02/13] misc: remove superfluous null pointer checks for optarg Ruediger Meier
2017-06-22  2:37 ` Ruediger Meier [this message]
2017-06-22 20:49   ` [PATCH 03/13] misc: fix some broken exit codes Ruediger Meier
2017-06-22  2:37 ` [PATCH 04/13] blkid: use errtryhelp instead of errtryh Ruediger Meier
2017-06-22  2:37 ` [PATCH 05/13] dmesg: do not accept any non-option arguments Ruediger Meier
2017-06-22  2:37 ` [PATCH 06/13] setarch: print usage error if no argument given Ruediger Meier
2017-06-22  8:38   ` Karel Zak
2017-06-22  8:44     ` Ruediger Meier
2017-06-22  2:37 ` [PATCH 07/13] setarch: use errtryhelp() Ruediger Meier
2017-06-22  2:37 ` [PATCH 08/13] fsck: add --help and --version Ruediger Meier
2017-06-22  2:37 ` [PATCH 09/13] login: " Ruediger Meier
2017-06-22  8:42   ` Karel Zak
2017-06-22  2:37 ` [PATCH 10/13] whereis: " Ruediger Meier
2017-06-22  2:37 ` [PATCH 11/13] more: " Ruediger Meier
2017-06-22  2:37 ` [PATCH 12/13] mkfs.cramfs: " Ruediger Meier
2017-06-22  2:37 ` [PATCH 13/13] misc: no more errtryh() Ruediger Meier
2017-06-26 13:04 ` [PATCH 00/13] usage cleanup part 1 Rüdiger Meier
2017-06-26 14:07   ` Karel Zak
2017-06-26 14:44     ` Rüdiger Meier
2017-06-26 20:37       ` Karel Zak

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=1498099066-24235-4-git-send-email-sweet_f_a@gmx.de \
    --to=sweet_f_a@gmx.de \
    --cc=util-linux@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).