$OpenBSD: patch-conformance_interfaces_sigaction_9-1_c,v 1.1 2018/05/08 22:13:36 bluhm Exp $

Check error code of fork(2), otherwise -1 may be killed.
Use defined exit codes.

Index: conformance/interfaces/sigaction/9-1.c
--- conformance/interfaces/sigaction/9-1.c.orig
+++ conformance/interfaces/sigaction/9-1.c
@@ -25,6 +25,7 @@
 #include <sys/time.h>
 #include <sys/types.h>
 #include <unistd.h>
+#include "posixtest.h"
 
 #define NUMSTOPS 10
 
@@ -50,7 +51,11 @@ int main()
 	sigemptyset(&act.sa_mask);
 	sigaction(SIGCHLD,  &act, 0);     
 
-	if ((pid = fork()) == 0) {
+	pid = fork();
+	if (pid == -1) {
+		perror("fork");
+		return PTS_UNRESOLVED;
+	} else if (pid == 0) {
 		/* child */
 		/* wait forever, or until we are 
 		   interrupted by a signal */
@@ -97,10 +102,10 @@ int main()
 
 	if (child_stopped == 0) {
 		printf("Test PASSED\n");
-		return 0;
+		return PTS_PASS;
 	}
 
 	printf("Test FAILED\n");
-	return -1;
+	return PTS_FAIL;
 }
 
