]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
misc: fix some broken exit codes
authorRuediger Meier <ruediger.meier@ga-group.nl>
Tue, 20 Jun 2017 18:01:32 +0000 (20:01 +0200)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 22 Jun 2017 19:51:40 +0000 (21:51 +0200)
These tools have special exit codes. They got changed mistakenly.

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

FIXME: STRTOXX_EXIT_CODE doesn't work as it should.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
disk-utils/fsck.c
disk-utils/fsck.cramfs.c
disk-utils/mkfs.cramfs.c
misc-utils/findfs.c
sys-utils/tunelp.c

index cb1b21278c3c3a9c0a2f5aad14d061639e7b82d6..5a418fc1f5d13257b261cc1ad24e082608f1b57b 100644 (file)
@@ -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
index 63033d626d2debfa0666ac4493e6ebae6edad770..952f15332e31d63f40dad2e0a258804985bf8624 100644 (file)
@@ -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)
index 77b4467e7a92d8ffb2686fbcd7d58f7df9c63b2a..041c6d74ee5f608c121646004e0eed71350f4362 100644 (file)
@@ -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;
 }
index 7935232eba4b8a879d580020eb6d08ad69974e77..7d2d803ddbd207aae9c3fb2283b2766cf0fd6071 100644 (file)
@@ -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);
index 8cfbe80a21ac0f0c2a6761b20388431ff1d75601..89afff1baf29725ff7b24c1684cfdc23bc92f6a8 100644 (file)
 
 #include "lp.h"
 #include "nls.h"
-#include "xalloc.h"
 #include "closestream.h"
 
+#define EXIT_LP_MALLOC         2
 #define STRTOXX_EXIT_CODE      3
 #define EXIT_LP_IO_ERR         4
 
 #include "strutils.h"
 
+#define XALLOC_EXIT_CODE EXIT_LP_MALLOC
+#include "xalloc.h"
+
 struct command {
        long op;
        long val;