Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107718702
D45365.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
805 B
Referenced Files
None
Subscribers
None
D45365.diff
View Options
diff --git a/tools/test/stress2/tools/flip.c b/tools/test/stress2/tools/flip.c
--- a/tools/test/stress2/tools/flip.c
+++ b/tools/test/stress2/tools/flip.c
@@ -85,8 +85,7 @@
struct stat st;
off_t pos;
size_t size;
- int fd, i, times;
- char c;
+ int c, fd, i, times;
times = 1;
size = 0;
@@ -126,18 +125,20 @@
}
for (i = 0; i < times; i++) {
+ char ch;
+
pos = arc4random() % size;
if (lseek(fd, pos, SEEK_SET) == -1)
err(1, "lseek()");
- if (read(fd, &c, 1) != 1)
+ if (read(fd, &ch, 1) != 1)
err(1, "read()");
if (arc4random() % 100 < 98)
- flip(&c, 1);
+ flip(&ch, 1);
else
- trash(&c);
+ trash(&ch);
if (lseek(fd, pos, SEEK_SET) == -1)
err(1, "lseek()");
- if (write(fd, &c, 1) != 1)
+ if (write(fd, &ch, 1) != 1)
err(1, "write()");
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 18, 6:49 PM (11 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15883367
Default Alt Text
D45365.diff (805 B)
Attached To
Mode
D45365: stress2: Use the proper type for the getopt(3) return value
Attached
Detach File
Event Timeline
Log In to Comment