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

Check error code of fork(2).

Index: conformance/interfaces/sigaction/4-34.c
--- conformance/interfaces/sigaction/4-34.c.orig
+++ conformance/interfaces/sigaction/4-34.c
@@ -41,7 +41,12 @@ void handler(int signo)
 int main()
 {
 	pid_t pid;
-	if ((pid = fork()) == 0) {
+
+	pid = fork();
+	if (pid == -1) {
+		perror("fork");
+		return PTS_UNRESOLVED;
+	} else if (pid == 0) {
 		/* child */
 
 		struct sigaction act;
