Skip to contentSkip to conversation

sigset posix conformance test

PATCH New Cyril Hrubis 1 participant 1 message Mar 19, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sigset posix conformance test

Hi!
As pointed out by Cheng Shun Xia one of open posix conformace tests is testing return value from sigset(SIGCHLD, SIG_HOLD) and expect this value to be SIG_HOLD, however this is true only if SIGCHLD is already blocked so we must ensure that. Patch is attached.

Signature · 2 lines
Cyril Hrubis
[email protected]
testcases/open_posix_testsuite/conformance/interfaces/sigset/8-1.c +12 -2
index f344b19..22b1f40 100644
@@ -15,12 +15,22 @@
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <errno.h>
+#include <string.h>
 #include "posixtest.h"
 
-int main()
+int main(void)
 {
+	sigset_t st;
+	sigemptyset(&st);
+	sigaddset(&st, SIGCHLD);
 
-        if (sigset(SIGCHLD,SIG_HOLD) != SIG_HOLD) {
+	if (sigprocmask(SIG_BLOCK, &st, NULL) < 0) {
+		printf("Test FAILED: sigprocmask(): %s\n", strerror(errno));
+		return PTS_FAIL;
+	}
+
+        if (sigset(SIGCHLD, SIG_HOLD) != SIG_HOLD) {
 		printf("Test FAILED: sigset() didn't return SIG_HOLD\n");
 		return PTS_FAIL;
 	}

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list