Page MenuHomeFreeBSD

D20078.id56727.diff
No OneTemporary

D20078.id56727.diff

Index: tools/regression/fsx/fsx.c
===================================================================
--- tools/regression/fsx/fsx.c
+++ tools/regression/fsx/fsx.c
@@ -48,6 +48,7 @@
# include <time.h>
# include <strings.h>
#endif
+#include <err.h>
#include <fcntl.h>
#include <sys/mman.h>
#ifndef MAP_FILE
@@ -274,6 +275,9 @@
prt("\t***RRRR***");
break;
case OP_WRITE:
+ // args[0]: offset
+ // args[1]: len
+ // args[2]: existing file length
prt("WRITE\t0x%x thru 0x%x\t(0x%x bytes)",
lp->args[0], lp->args[0] + lp->args[1] - 1,
lp->args[1]);
@@ -993,6 +997,7 @@
char *endp;
char goodfile[1024];
char logfile[1024];
+ struct timespec now;
goodfile[0] = 0;
logfile[0] = 0;
@@ -1115,8 +1120,11 @@
break;
case 'S':
seed = getnum(optarg, &endp);
- if (seed == 0)
- seed = time(0) % 10000;
+ if (seed == 0) {
+ if (clock_gettime(CLOCK_REALTIME, &now) != 0)
+ err(1, "clock_gettime");
+ seed = now.tv_nsec % 10000;
+ }
if (!quiet)
fprintf(stdout, "Seed set to %d\n", seed);
if (seed < 0)
@@ -1206,7 +1214,7 @@
prterr(fname);
warn("main: error on write");
} else
- warn("main: short write, 0x%x bytes instead of 0x%x\n",
+ warn("main: short write, 0x%x bytes instead of 0x%lx\n",
(unsigned)written, maxfilelen);
exit(98);
}

File Metadata

Mime Type
text/plain
Expires
Mon, Oct 13, 1:56 AM (9 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23651011
Default Alt Text
D20078.id56727.diff (1 KB)

Event Timeline