exitcodes: add EXIT_NOTSUPP

This commit is contained in:
Thomas Weißschuh 2023-01-02 13:58:03 +00:00
parent 97af76c467
commit c3e29c68f0
3 changed files with 5 additions and 4 deletions

View 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 */

View 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);
}

View file

@ -14,6 +14,7 @@
# GNU General Public License for more details.
#
TS_EXIT_NOTSUPP=2
function ts_abspath {
cd $1