$NetBSD: patch-ag,v 1.3 2025/04/21 16:23:10 wiz Exp $ --- src/fstime.c.orig 1999-07-28 21:47:02.000000000 +0000 +++ src/fstime.c @@ -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,7 +149,6 @@ int w_test(void) unsigned long counted = 0L; unsigned long tmp; long f_blocks; - extern int sigalarm; /* Sync and let it settle */ sync(); @@ -176,6 +175,8 @@ int w_test(void) lseek(f, 0L, 0); /* rewind */ } + fsync(f); + /* stop clock */ fprintf(stderr, "%d second sample\n", seconds); write_score = counted/((long)seconds * COUNTPERK); @@ -191,8 +192,6 @@ int r_test(void) { unsigned long counted = 0L; unsigned long tmp; - extern int sigalarm; - extern int errno; /* Sync and let it settle */ sync(); @@ -229,6 +228,8 @@ int r_test(void) counted += COUNTPERBUF; } + fsync(f); + /* stop clock */ fprintf(stderr, "%d second sample\n", seconds); read_score = counted / ((long)seconds * COUNTPERK); @@ -244,7 +245,6 @@ int c_test(void) { unsigned long counted = 0L; unsigned long tmp; - extern int sigalarm; sync(); sleep(2 + seconds/4); @@ -309,7 +309,6 @@ int c_test(void) void stop_count(void) { - extern int sigalarm; sigalarm = 1; }