v1->v2:
v1:use the sigset for twice times.
v2:not use sigset for twice, but just check the SIG_ERR.
According to the posix IEEE Std 1003.1-2008:Upon successful completion,
sigset() shall return SIG_HOLD if the signal had been blocked and the
signal's previous disposition if it had not been blocked.
In these two test instances, the first time when sigset() is called, it
then calls the __sigprocmask() to mask the signal to SIG_BLOCK and checks
the old set to see if the signal was blocked previously, and it's not.
So it will not return SIG_HOLD, but the sigset() already runs successfully.
Then, after the first time we calls the sigset, the signal has already be
blocked, and now, calls the sigset() second, it will return SIG_HOLD, since
the signal had been blocked when we called the sigset() first time.
We are now checking the return value of the first time calling. So, if
it fails, it'll return SIG_ERR instead. Just need to check the SIG_ERR.
Signed-off-by: Wanlong Gao <[email protected]>
---
.../conformance/interfaces/sigset/6-1.c | 4 ++--
.../conformance/interfaces/sigset/7-1.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigset/6-1.c
b/testcases/open_posix_testsuite/conformance/interfaces/sigset/6-1.c
index 551cc31..1923912 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigset/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigset/6-1.c
@@ -41,7 +41,7 @@ int main()
return PTS_UNRESOLVED;
}
- if (sigset(SIGCHLD,SIG_HOLD) != SIG_HOLD) {
+ if (sigset(SIGCHLD,SIG_HOLD) == SIG_ERR) {
perror("Unexpected error while using sigset()");
return PTS_UNRESOLVED;
}
@@ -59,4 +59,4 @@ int main()
}
return PTS_PASS;
-}
\ No newline at end of file
+}
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigset/7-1.c
b/testcases/open_posix_testsuite/conformance/interfaces/sigset/7-1.c
index bdb26c8..898c2b4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigset/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigset/7-1.c
@@ -46,7 +46,7 @@ int main()
return PTS_UNRESOLVED;
}
- if (sigset(SIGCHLD,SIG_HOLD) != SIG_HOLD) {
+ if (sigset(SIGCHLD,SIG_HOLD) == SIG_ERR) {
perror("Unexpected error while using sigset()");
return PTS_UNRESOLVED;
}
@@ -70,4 +70,4 @@ int main()
return PTS_FAIL;
}
return PTS_PASS;
-}
\ No newline at end of file
+}
--
1.7.6
------------------------------------------------------------------------------
10 Tips for Better Web Security
Learn 10 ways to better secure your business today. Topics covered include:
Web security, SSL, hacker attacks & Denial of Service (DoS), private keys,
security Microsoft Exchange, secure Instant Messaging, and much more.
http://www.accelacomm.com/jaw/sfnl/114/51426210/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list