From 0b2b32e8a7a6aed1e3ff1cfc3f63cf33361a67b8 Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Thu, 22 Jun 2017 22:16:14 +0200 Subject: misc: fix more strutils related exit codes Found by grep: grep -l "\bEXIT_\|exit *( *[0-9][0-9] *)\|strutils\.h" $(grep -L \ strutils_set_exitcode $(git grep -l "_EX_\|FINDFS_\|BLKID_EXIT\|EX_USAGE" -- "*.c")) The Command shows also some false positives (fstrim.c, context_mount.c, ...) Signed-off-by: Ruediger Meier --- sys-utils/hwclock.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys-utils/hwclock.c') diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c index 5433cd000..325106afc 100644 --- a/sys-utils/hwclock.c +++ b/sys-utils/hwclock.c @@ -1326,6 +1326,8 @@ int main(int argc, char **argv) }; int excl_st[ARRAY_SIZE(excl)] = UL_EXCL_STATUS_INIT; + strutils_set_exitcode(EX_USAGE); + /* Remember what time we were invoked */ gettimeofday(&startup_time, NULL); -- cgit v1.2.3-55-g7522 From 778ca2a0d49dc6110a18214c56dd8ae9993983de Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Thu, 22 Jun 2017 22:17:14 +0200 Subject: misc: fix xalloc.h related exit codes Found by: grep -L "XALLOC_EXIT_CODE" $(grep -l "xalloc\.h" \ $(git grep -l "_EX_\|FINDFS_\|BLKID_EXIT\|EX_USAGE" -- "*.c")) Signed-off-by: Ruediger Meier --- disk-utils/mkfs.minix.c | 2 ++ misc-utils/blkid.c | 2 ++ sys-utils/hwclock.c | 1 + sys-utils/mount.c | 4 +++- sys-utils/umount.c | 2 ++ 5 files changed, 10 insertions(+), 1 deletion(-) (limited to 'sys-utils/hwclock.c') diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c index 96d36b034..98a62668a 100644 --- a/disk-utils/mkfs.minix.c +++ b/disk-utils/mkfs.minix.c @@ -77,6 +77,8 @@ #include "all-io.h" #include "closestream.h" #include "ismounted.h" + +#define XALLOC_EXIT_CODE MKFS_EX_ERROR #include "xalloc.h" #define MINIX_ROOT_INO 1 diff --git a/misc-utils/blkid.c b/misc-utils/blkid.c index 73731f0b8..3e6f1ce06 100644 --- a/misc-utils/blkid.c +++ b/misc-utils/blkid.c @@ -42,6 +42,8 @@ #include "nls.h" #include "ttyutils.h" + +#define XALLOC_EXIT_CODE BLKID_EXIT_OTHER /* x.*alloc(), xstrndup() */ #include "xalloc.h" struct blkid_control { diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c index 325106afc..5c341446d 100644 --- a/sys-utils/hwclock.c +++ b/sys-utils/hwclock.c @@ -71,6 +71,7 @@ #include #define OPTUTILS_EXIT_CODE EX_USAGE +#define XALLOC_EXIT_CODE EX_OSERR #include "c.h" #include "closestream.h" diff --git a/sys-utils/mount.c b/sys-utils/mount.c index 0f7fa9097..ffe294e3f 100644 --- a/sys-utils/mount.c +++ b/sys-utils/mount.c @@ -36,10 +36,12 @@ #include "c.h" #include "env.h" #include "strutils.h" -#include "xalloc.h" #include "closestream.h" #include "canonicalize.h" +#define XALLOC_EXIT_CODE MNT_EX_SYSERR +#include "xalloc.h" + #define OPTUTILS_EXIT_CODE MNT_EX_USAGE #include "optutils.h" diff --git a/sys-utils/umount.c b/sys-utils/umount.c index ed8fd4fe2..2dfb13975 100644 --- a/sys-utils/umount.c +++ b/sys-utils/umount.c @@ -36,6 +36,8 @@ #include "closestream.h" #include "pathnames.h" #include "canonicalize.h" + +#define XALLOC_EXIT_CODE MNT_EX_SYSERR #include "xalloc.h" static int table_parser_errcb(struct libmnt_table *tb __attribute__((__unused__)), -- cgit v1.2.3-55-g7522