mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
holetest: Use pid_t type for fork(2) return value
Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
committed by
Eryu Guan
parent
64b9091530
commit
cca45d1b92
+6
-5
@@ -199,22 +199,22 @@ int test_this(int fd, loff_t sz)
|
||||
tid[i] = (uint64_t)t[i];
|
||||
printf("INFO: thread %d created\n", i);
|
||||
} else {
|
||||
pid_t pid;
|
||||
/*
|
||||
* Flush stdout before fork, otherwise some lines get
|
||||
* duplicated... ?!?!?
|
||||
*/
|
||||
fflush(stdout);
|
||||
tid[i] = fork();
|
||||
if (tid[i] < 0) {
|
||||
pid = fork();
|
||||
if (pid < 0) {
|
||||
int j;
|
||||
|
||||
perror("fork");
|
||||
for (j = 0; j < i; j++)
|
||||
waitpid(tid[j], NULL, 0);
|
||||
exit(21);
|
||||
}
|
||||
/* Child? */
|
||||
if (!tid[i]) {
|
||||
} else if (!pid) {
|
||||
/* Child? */
|
||||
void *ret;
|
||||
|
||||
if (use_wr[i])
|
||||
@@ -223,6 +223,7 @@ int test_this(int fd, loff_t sz)
|
||||
ret = pt_page_marker(&targs[i]);
|
||||
exit(ret ? 1 : 0);
|
||||
}
|
||||
tid[i] = pid;
|
||||
printf("INFO: process %d created\n", i);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user