mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-27 15:52:28 +00:00
Make zipos_test hermetic
This commit is contained in:
parent
6be9477b9e
commit
8b0e42a31b
1 changed files with 9 additions and 8 deletions
|
@ -117,7 +117,7 @@ TEST(zipos, closeAfterVfork) {
|
||||||
ASSERT_SYS(0, 3, open("/zip/libc/testlib/hyperion.txt", O_RDONLY));
|
ASSERT_SYS(0, 3, open("/zip/libc/testlib/hyperion.txt", O_RDONLY));
|
||||||
SPAWN(vfork);
|
SPAWN(vfork);
|
||||||
ASSERT_SYS(0, 0, close(3));
|
ASSERT_SYS(0, 0, close(3));
|
||||||
ASSERT_SYS(0, 3, open("/etc/hosts", O_RDONLY));
|
ASSERT_SYS(0, 3, open("/dev/null", O_RDONLY));
|
||||||
ASSERT_SYS(0, 0, close(3));
|
ASSERT_SYS(0, 0, close(3));
|
||||||
ASSERT_SYS(EBADF, -1, close(3));
|
ASSERT_SYS(EBADF, -1, close(3));
|
||||||
EXITS(0);
|
EXITS(0);
|
||||||
|
@ -154,7 +154,8 @@ static void *pthread_main(void *ptr) {
|
||||||
ASSERT_NE(-1, rc);
|
ASSERT_NE(-1, rc);
|
||||||
children[i].fd = rc;
|
children[i].fd = rc;
|
||||||
children[i].id = 2 * s->id + i;
|
children[i].id = 2 * s->id + i;
|
||||||
ASSERT_SYS(0, 0, pthread_create(&children[i].thread, NULL, pthread_main,
|
ASSERT_SYS(0, 0,
|
||||||
|
pthread_create(&children[i].thread, NULL, pthread_main,
|
||||||
children + i));
|
children + i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue