From def1a8a91c6aee5b2d14f56d7c946c672bb0e7b4 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 6 Nov 2007 22:06:40 +0000 Subject: [PATCH] Patch by Vasilis Kaoutsis: The Open Group Base Specs for signal() require errno to be set to a positive value on error, but since BeOS error codes are negative numbers, we can't comply. Changed the tests accordingly to check for the expected error code (EINVAL) instead. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22845 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../posixtestsuite/conformance/interfaces/signal/6-1.c | 6 +++--- .../posixtestsuite/conformance/interfaces/signal/7-1.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/6-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/6-1.c index ea9e0a9fd4..d032e2be3f 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/6-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/6-1.c @@ -24,15 +24,15 @@ void myhandler(int signo) int main() { - errno = -1; + errno = 0; if (signal(-1, myhandler) != SIG_ERR) { printf("Test FAILED: signal() didn't return SIG_ERR even though invalid signal number was passed to it\n"); return PTS_FAIL; } - if (errno <= 0) { - printf("Test FAILED: errno wasn't set to a positive number even though invalid signal number was passed to the signal() function\n"); + if (errno != EINVAL) { + printf("Test FAILED: errno wasn't set to EINVAL even though invalid signal number was passed to the signal() function\n"); return PTS_FAIL; } printf("signal(): Test passed\n"); diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/7-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/7-1.c index d4a59427d7..e213dacb32 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/7-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/7-1.c @@ -24,15 +24,15 @@ void myhandler(int signo) int main() { - errno = -1; + errno = 0; if (signal(SIGKILL, myhandler) != SIG_ERR) { printf("Test FAILED: signal() didn't return SIG_ERR even though a non-catchable signal was passed to it\n"); return PTS_FAIL; } - if (errno <= 0) { - printf("Test FAILED: errno wasn't set to a positive number even though a non-catchable signal was passed to the signal() function\n"); + if (errno != EINVAL) { + printf("Test FAILED: errno wasn't set to EINVAL even though a non-catchable signal was passed to the signal() function\n"); return PTS_FAIL; } printf("signal(): Test passed\n");