1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Revert "stress2: Replace rename() with arc4random()"

This reverts commit f65d0b18d9.

Misleading commit message
This commit is contained in:
Peter Holm 2024-06-11 15:51:21 +02:00
parent 9a4813e1dc
commit cb53f83d8a
2 changed files with 3 additions and 4 deletions

View File

@ -137,7 +137,7 @@ write_file(void)
unlink(path);
}
fprintf(fp, "blah blah blah garbage %ld\n", (long)arc4random());
fprintf(fp, "blah blah blah garbage %ld\n", random());
fclose(fp);
if (rename(path, filename) < 0) {
warn("rename");
@ -150,7 +150,7 @@ random_sleep(int base, int slop)
{
long val;
val = arc4random() % slop;
val = random() % slop;
usleep(base + val);
}

View File

@ -886,12 +886,11 @@ test(void)
{
unsigned long offset;
unsigned long size = maxoplen;
unsigned long rv;
unsigned long rv = random();
unsigned long op = rv % (3 + !lite + mapped_writes);
/* turn off the map read if necessary */
arc4random_buf(&rv, sizeof(rv));
if (op == 2 && !mapped_reads)
op = 0;