Don't declare errno manually, depend on errno.h for it. While here,

fix the signal handling to use a volatile variable. Compilers can
optimise the access otherwise. Bump revision, since this is a bugfix.

Reviewed by jlam and the maintainer.
This commit is contained in:
joerg 2005-11-07 15:46:26 +00:00
parent 5bad78c8ce
commit ca7eaadc80
3 changed files with 43 additions and 13 deletions

View file

@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.16 2005/10/31 17:09:45 tv Exp $
# $NetBSD: Makefile,v 1.17 2005/11/07 15:46:26 joerg Exp $
DISTNAME= unixbench-4.1.0
PKGNAME= ${DISTNAME:S/unix/byte/}
PKGREVISION= 1
PKGREVISION= 2
CATEGORIES= benchmarks
MASTER_SITES= http://www.tux.org/pub/tux/benchmarks/System/unixbench/
EXTRACT_SUFX= .tgz

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.9 2005/10/31 17:09:45 tv Exp $
$NetBSD: distinfo,v 1.10 2005/11/07 15:46:26 joerg Exp $
SHA1 (unixbench-4.1.0.tgz) = 0a43d9cf08869c0f81bde4647be6bcf76c064248
RMD160 (unixbench-4.1.0.tgz) = 182e8a35574df0cd7984662bf99d47a7e24e7e03
@ -9,4 +9,4 @@ SHA1 (patch-ac) = ebfb09da84c96f8c6f48293c65a74dcf8a43cff5
SHA1 (patch-ad) = 3a1b788d9fa51fc168d59d8c87b1f476df2d5f41
SHA1 (patch-ae) = fbbce3deed7f0421034c1d57b66b1967ad8bddf1
SHA1 (patch-af) = 725a82ecb5f15ec47dda39d53a16027a0e4a7efd
SHA1 (patch-ag) = 03916e56921f05ebfde2cb3c9944d528117c11c6
SHA1 (patch-ag) = 27014f92b6e15756a0b6b5ae9fdeca9dd7d261cc

View file

@ -1,10 +1,21 @@
$NetBSD: patch-ag,v 1.1 2005/10/31 17:09:45 tv Exp $
$NetBSD: patch-ag,v 1.2 2005/11/07 15:46:26 joerg Exp $
--- src/fstime.c.orig 1999-07-28 17:47:02.000000000 -0400
--- src/fstime.c.orig 1999-07-28 21:47:02.000000000 +0000
+++ src/fstime.c
@@ -151,11 +151,13 @@ int w_test(void)
@@ -88,7 +88,7 @@ int g;
int i;
void stop_count();
void clean_up();
-int sigalarm = 0;
+static volatile sig_atomic_t sigalarm = 0;
/******************** MAIN ****************************/
@@ -149,13 +149,14 @@ int w_test(void)
unsigned long counted = 0L;
unsigned long tmp;
long f_blocks;
extern int sigalarm;
- extern int sigalarm;
+#ifndef __INTERIX
/* Sync and let it settle */
@ -16,7 +27,7 @@ $NetBSD: patch-ag,v 1.1 2005/10/31 17:09:45 tv Exp $
signal(SIGALRM,stop_count);
sigalarm = 0; /* reset alarm flag */
@@ -176,6 +178,8 @@ int w_test(void)
@@ -176,6 +177,8 @@ int w_test(void)
lseek(f, 0L, 0); /* rewind */
}
@ -25,9 +36,12 @@ $NetBSD: patch-ag,v 1.1 2005/10/31 17:09:45 tv Exp $
/* stop clock */
fprintf(stderr, "%d second sample\n", seconds);
write_score = counted/((long)seconds * COUNTPERK);
@@ -194,11 +198,13 @@ int r_test(void)
extern int sigalarm;
extern int errno;
@@ -191,14 +194,14 @@ int r_test(void)
{
unsigned long counted = 0L;
unsigned long tmp;
- extern int sigalarm;
- extern int errno;
+#ifndef __INTERIX
/* Sync and let it settle */
@ -39,7 +53,7 @@ $NetBSD: patch-ag,v 1.1 2005/10/31 17:09:45 tv Exp $
/* rewind */
errno = 0;
@@ -229,6 +235,8 @@ int r_test(void)
@@ -229,6 +232,8 @@ int r_test(void)
counted += COUNTPERBUF;
}
@ -48,3 +62,19 @@ $NetBSD: patch-ag,v 1.1 2005/10/31 17:09:45 tv Exp $
/* stop clock */
fprintf(stderr, "%d second sample\n", seconds);
read_score = counted / ((long)seconds * COUNTPERK);
@@ -244,7 +249,6 @@ int c_test(void)
{
unsigned long counted = 0L;
unsigned long tmp;
- extern int sigalarm;
sync();
sleep(2 + seconds/4);
@@ -309,7 +313,6 @@ int c_test(void)
void stop_count(void)
{
- extern int sigalarm;
sigalarm = 1;
}