mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
fdasd: Fix exit status in error cases
In error cases, fdasd returns -1 which results in the return value 255. This is due to the fact that only the low-order 8 bits are used for the status value. See 2.13 Status Information [1] in the POSIX standard and the exit() POSIX man page [2] for more details. Instead of returning -1, use the EXIT_FAILURE constant to indicate unsuccessful termination properly. [1]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html [2]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/exit.html Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
@@ -397,7 +397,7 @@ static void fdasd_error(fdasd_anchor_t *anc, enum fdasd_failure why, char *str)
|
||||
fputc('\n', stderr);
|
||||
fputs(err_str, stderr);
|
||||
|
||||
fdasd_exit(anc, -1);
|
||||
fdasd_exit(anc, EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3040,5 +3040,5 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user