summaryrefslogtreecommitdiff
path: root/stressfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'stressfs.c')
-rw-r--r--stressfs.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/stressfs.c b/stressfs.c
index 21a5d16..5d4fee2 100644
--- a/stressfs.c
+++ b/stressfs.c
@@ -14,21 +14,20 @@
int
main(int argc, char *argv[])
{
- int i;
+ int fd, i;
+ char path[] = "stressfs0";
+
printf(1, "stressfs starting\n");
- for (i = 0; i < 4; i++) {
- if (fork() > 0) {
+ for(i = 0; i < 4; i++)
+ if(fork() > 0)
break;
- }
- }
printf(1, "%d\n", i);
- char path[] = "stressfs0";
path[8] += i;
- int fd = open(path, O_CREATE | O_RDWR);
- for (i = 0; i < 100; i++)
+ fd = open(path, O_CREATE | O_RDWR);
+ for(i = 0; i < 100; i++)
printf(fd, "%d\n", i);
close(fd);