logo

utils

~/.local/bin tools and git-hooks git clone https://hacktivis.me/git/utils.git
commit: 445d7356995342567674646f51dd37cb4effbcd8
parent e327aa07cef8f2ffa6484122cf4aaae22dab6a86
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed,  2 Mar 2022 19:59:06 +0100

tests: musl fixes

Diffstat:

Mbin/errno.c2+-
Mbin/tty.c4++--
Mtest-bin/errno2++
3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/bin/errno.c b/bin/errno.c @@ -33,7 +33,7 @@ main(int argc, char *argv[]) return 1; } - if(puts(msg) <= 0) + if(puts(msg) < 0) { return 1; } diff --git a/bin/tty.c b/bin/tty.c @@ -15,7 +15,7 @@ main(void) { if(errno == ENOTTY) { - if(puts("not a tty") <= 0) + if(puts("not a tty") < 0) { return 2; } @@ -29,7 +29,7 @@ main(void) } } - if(puts(name) <= 0) + if(puts(name) < 0) { return 2; } diff --git a/test-bin/errno b/test-bin/errno @@ -22,6 +22,8 @@ atf_test_case einval einval_body() { if has_glibc; then atf_check -s exit:0 -o "inline:Unknown error -1\n" ../bin/errno -1 + elif has_musl; then + atf_check -s exit:0 -o "inline:No error information\n" ../bin/errno -1 else atf_check -s exit:1 -e "inline:errno: strerror: Invalid argument\n" ../bin/errno -1 fi