| OLD | NEW |
| 1 // Copyright Martin J. Bligh & Google. <mbligh@google.com>. | 1 // Copyright Martin J. Bligh & Google. <mbligh@google.com>. |
| 2 // New Year's Eve, 2006 | 2 // New Year's Eve, 2006 |
| 3 // Released under the GPL v2. | 3 // Released under the GPL v2. |
| 4 // | 4 // |
| 5 // Compile with -D_FILE_OFFSET_BITS=64 -D _GNU_SOURCE | 5 // Compile with -D_FILE_OFFSET_BITS=64 -D _GNU_SOURCE |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <unistd.h> | 9 #include <unistd.h> |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 unsigned int seconds = 15; | 36 unsigned int seconds = 15; |
| 37 unsigned int linear_tasks = 1; | 37 unsigned int linear_tasks = 1; |
| 38 unsigned int random_tasks = 4; | 38 unsigned int random_tasks = 4; |
| 39 unsigned int blocks; | 39 unsigned int blocks; |
| 40 unsigned int sectors_per_block; | 40 unsigned int sectors_per_block; |
| 41 unsigned int signature = 0; | 41 unsigned int signature = 0; |
| 42 unsigned int stop_on_error = 0; | 42 unsigned int stop_on_error = 0; |
| 43 | 43 |
| 44 void die(char *error) | 44 void die(char *error) |
| 45 { | 45 { |
| 46 » fprintf(stderr, error); | 46 » fprintf(stderr, "%s\n", error); |
| 47 » fprintf(stderr, "\n"); | |
| 48 exit(1); | 47 exit(1); |
| 49 } | 48 } |
| 50 | 49 |
| 51 /* | 50 /* |
| 52 * Fill a block with it's own sector number | 51 * Fill a block with it's own sector number |
| 53 * buf must be at least blocksize | 52 * buf must be at least blocksize |
| 54 */ | 53 */ |
| 55 void write_block(int fd, unsigned int block, struct pattern *buffer) | 54 void write_block(int fd, unsigned int block, struct pattern *buffer) |
| 56 { | 55 { |
| 57 unsigned int i, sec_offset, sector; | 56 unsigned int i, sec_offset, sector; |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 | 369 |
| 371 for (tasks = 0; tasks < linear_tasks + random_tasks + 4; tasks++) { | 370 for (tasks = 0; tasks < linear_tasks + random_tasks + 4; tasks++) { |
| 372 pid = wait(&retcode); | 371 pid = wait(&retcode); |
| 373 if (retcode != 0) { | 372 if (retcode != 0) { |
| 374 printf("pid %d exited with status %d\n", pid, retcode); | 373 printf("pid %d exited with status %d\n", pid, retcode); |
| 375 exit(1); | 374 exit(1); |
| 376 } | 375 } |
| 377 } | 376 } |
| 378 return 0; | 377 return 0; |
| 379 } | 378 } |
| OLD | NEW |