[BACK]Return to patch-cpubench_c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / benchmarks / ubench / patches

File: [cvs.NetBSD.org] / pkgsrc / benchmarks / ubench / patches / patch-cpubench_c (download)

Revision 1.1, Sat Jun 23 18:33:38 2012 UTC (10 years, 7 months ago) by dholland
Branch: MAIN
CVS Tags: pkgsrc-2022Q4-base, pkgsrc-2022Q4, pkgsrc-2022Q3-base, pkgsrc-2022Q3, pkgsrc-2022Q2-base, pkgsrc-2022Q2, pkgsrc-2022Q1-base, pkgsrc-2022Q1, pkgsrc-2021Q4-base, pkgsrc-2021Q4, pkgsrc-2021Q3-base, pkgsrc-2021Q3, pkgsrc-2021Q2-base, pkgsrc-2021Q2, pkgsrc-2021Q1-base, pkgsrc-2021Q1, pkgsrc-2020Q4-base, pkgsrc-2020Q4, pkgsrc-2020Q3-base, pkgsrc-2020Q3, pkgsrc-2020Q2-base, pkgsrc-2020Q2, pkgsrc-2020Q1-base, pkgsrc-2020Q1, pkgsrc-2019Q4-base, pkgsrc-2019Q4, pkgsrc-2019Q3-base, pkgsrc-2019Q3, pkgsrc-2019Q2-base, pkgsrc-2019Q2, pkgsrc-2019Q1-base, pkgsrc-2019Q1, pkgsrc-2018Q4-base, pkgsrc-2018Q4, pkgsrc-2018Q3-base, pkgsrc-2018Q3, pkgsrc-2018Q2-base, pkgsrc-2018Q2, pkgsrc-2018Q1-base, pkgsrc-2018Q1, pkgsrc-2017Q4-base, pkgsrc-2017Q4, pkgsrc-2017Q3-base, pkgsrc-2017Q3, pkgsrc-2017Q2-base, pkgsrc-2017Q2, pkgsrc-2017Q1-base, pkgsrc-2017Q1, pkgsrc-2016Q4-base, pkgsrc-2016Q4, pkgsrc-2016Q3-base, pkgsrc-2016Q3, pkgsrc-2016Q2-base, pkgsrc-2016Q2, pkgsrc-2016Q1-base, pkgsrc-2016Q1, pkgsrc-2015Q4-base, pkgsrc-2015Q4, pkgsrc-2015Q3-base, pkgsrc-2015Q3, pkgsrc-2015Q2-base, pkgsrc-2015Q2, pkgsrc-2015Q1-base, pkgsrc-2015Q1, pkgsrc-2014Q4-base, pkgsrc-2014Q4, pkgsrc-2014Q3-base, pkgsrc-2014Q3, pkgsrc-2014Q2-base, pkgsrc-2014Q2, pkgsrc-2014Q1-base, pkgsrc-2014Q1, pkgsrc-2013Q4-base, pkgsrc-2013Q4, pkgsrc-2013Q3-base, pkgsrc-2013Q3, pkgsrc-2013Q2-base, pkgsrc-2013Q2, pkgsrc-2013Q1-base, pkgsrc-2013Q1, pkgsrc-2012Q4-base, pkgsrc-2012Q4, pkgsrc-2012Q3-base, pkgsrc-2012Q3, pkgsrc-2012Q2-base, pkgsrc-2012Q2, HEAD

Fix broken Solaris build by not using sys_errlist[]. One minor other
fix to pass -Wall.

$NetBSD: patch-cpubench_c,v 1.1 2012/06/23 18:33:38 dholland Exp $

Use standard headers.
Use strerror(), not sys_errlist[].

--- cpubench.c~	2000-05-29 03:21:13.000000000 +0000
+++ cpubench.c
@@ -25,6 +25,8 @@
 #include <sys/types.h>
 #include <sys/times.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 #include <signal.h>
 #include <setjmp.h>
@@ -33,14 +35,6 @@
 #include <math.h>
 #include <time.h>
 
-#if defined HPUX || defined _AIX
-extern char *sys_errlist[];
-#endif
-#ifdef SunOS
-extern char *_sys_errlist[];
-#define sys_errlist _sys_errlist
-#endif
-
 #ifdef SunOS
 extern		sigjmp_buf	env;
 #else
@@ -121,7 +115,7 @@ int cpubench()
   double dlt;
   if ( pipe(sv) == -1 )
     {
-      fprintf(stderr,"****  cpubench: pipe: %s\n",sys_errlist[errno]);
+      fprintf(stderr,"****  cpubench: pipe: %s\n", strerror(errno));
       CPUflag=0;
       return 0;
     }
@@ -162,7 +156,7 @@ int cpubench()
   child_pid[child_number]=fork();
   if ( child_pid[child_number] == -1 )
     {
-      fprintf(stderr,"****  cpubench: fork: %s\n",sys_errlist[errno]);
+      fprintf(stderr,"****  cpubench: fork: %s\n", strerror(errno));
       CPUflag=0;
       return 0;
     }