]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
exitcodes: add EXIT_NOTSUPP
authorThomas Weißschuh <thomas@t-8ch.de>
Mon, 2 Jan 2023 13:58:03 +0000 (13:58 +0000)
committerThomas Weißschuh <thomas@t-8ch.de>
Tue, 3 Jan 2023 20:19:32 +0000 (20:19 +0000)
include/exitcodes.h
sys-utils/blkdiscard.c
tests/functions.sh

index f28f68e454642805fdb6a1aa30997d4ba2327333..b29c98c0edcbd57ccb5c3b54727a61583ede15b3 100644 (file)
@@ -22,4 +22,6 @@
 #define FSCK_EX_USAGE          16      /* Usage or syntax error */
 #define FSCK_EX_LIBRARY                128     /* Shared library error */
 
+#define EXIT_NOTSUPP 2
+
 #endif /* UTIL_LINUX_EXITCODES_H */
index 68e6f107f94a71a8696dc340541e4d196bf36f6e..ed8d6a00365c08c7802ecd4cdca88505e4e7a7d0 100644 (file)
@@ -47,9 +47,7 @@
 #include "c.h"
 #include "closestream.h"
 #include "monotonic.h"
-
-/* exit() status if discard unsupported by device */
-#define BLKDISCARD_EXIT_NOTSUPP                (EXIT_FAILURE + 1)
+#include "exitcodes.h"
 
 #ifndef BLKDISCARD
 # define BLKDISCARD    _IO(0x12,119)
@@ -159,7 +157,7 @@ static void __attribute__((__noreturn__)) err_on_ioctl(
                        const char *ioctlname, const char *path)
 {
        int exno = errno == EOPNOTSUPP ?
-                       BLKDISCARD_EXIT_NOTSUPP : EXIT_FAILURE;
+                       EXIT_NOTSUPP : EXIT_FAILURE;
 
        err(exno, _("%s: %s ioctl failed"), ioctlname, path);
 }
index ed578d2e7812de53c0a0fb3e3c4badf78195323f..5752a2cdaeed089b0e262dba1eb281ffae12883d 100644 (file)
@@ -14,6 +14,7 @@
 # GNU General Public License for more details.
 #
 
+TS_EXIT_NOTSUPP=2
 
 function ts_abspath {
        cd $1