summaryrefslogtreecommitdiff
path: root/benchmarks/iozone/patches/patch-ab
blob: aa2ec5764c77130a5ca4ecd2a17e3a0e96d1ac9d (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
$NetBSD: patch-ab,v 1.2 2000/12/14 02:40:20 wiz Exp $

--- iozone.c.orig	Tue Sep 14 23:38:16 1999
+++ iozone.c
@@ -908,10 +908,10 @@
                 case 'M':       /* Report machine name and OS */
                         pi=popen("uname -a", "r");
                         fread(reply,99,1,pi);
-			m=reply;
-                        while(*m!='\n') /* Strip after new line */
-                                m++;
-                        *m=0;
+			reply[98] = '\0';
+			m=strchr(reply, '\n'); /* Strip after new line */
+                        if (m != NULL)
+			    *m=0;
                         printf("\n\tMachine = %s\n",reply);
                         pclose(pi);
                         break;
@@ -6130,7 +6130,11 @@
 #endif
                 exit(119);
         }
+#ifndef __NetBSD__
         addr = (char *)shmat(shmid, 0, SHM_W);
+#else
+        addr = (char *)shmat(shmid, 0, 0);
+#endif
 #ifdef __LP64__
         if((long long)addr == (long long)-1)
 #else