summaryrefslogtreecommitdiff
path: root/benchmarks/bytebench/patches/patch-ac
blob: de3b3969e5a25c104ce723b1fab21f8f9e11609a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
$NetBSD: patch-ac,v 1.3 2002/01/09 11:24:37 jlam Exp $

--- src/looper.c.orig	Wed Jul 28 14:45:08 1999
+++ src/looper.c
@@ -26,6 +26,7 @@
 #include <stdlib.h>
 #include <sys/wait.h>
 #include "timeit.c"
+#include <sys/param.h>
 
 unsigned long iter;
 char *cmd_argv[28];
@@ -88,12 +89,34 @@
 		exit(2);
 		} 
 	else
+		{
 		/* master */
 		wait(&status);
-	if (status != 0) 
-		{
-		printf("Bad wait status: 0x%x\n", status);
-		exit(2);
+#if (defined(NetBSD) && (NetBSD < 199810))
+		/* NetBSD 1.3H and lower have a bug in dc */
+		if (strcmp(cmd_argv[0],"dc") != 0)
+			{
+			if (WIFSIGNALED(status))
+				{
+				printf("signaled: %d\n",WTERMSIG(status));
+				exit(2);
+				}
+				if (WIFEXITED(status))
+					{
+					if (WEXITSTATUS(status) != 0)
+						{
+						printf("Exit code: %d\n",WEXITSTATUS(status));
+						exit(2);
+						}
+					}
+			} /* NetBSD 1.3H */
+#else
+		if (status != 0) 
+			{
+			printf("Bad wait status: 0x%x\n", status);
+			exit(2);
+			}
+#endif
 		}
 	iter++;
 	}