Make zipos_test hermetic

This commit is contained in:
Justine Tunney 2023-12-28 04:22:15 -08:00
parent 6be9477b9e
commit 8b0e42a31b
No known key found for this signature in database
GPG key ID: BE714B4575D6E328

View file

@ -117,7 +117,7 @@ TEST(zipos, closeAfterVfork) {
ASSERT_SYS(0, 3, open("/zip/libc/testlib/hyperion.txt", O_RDONLY));
SPAWN(vfork);
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(EBADF, -1, close(3));
EXITS(0);
@ -154,7 +154,8 @@ static void *pthread_main(void *ptr) {
ASSERT_NE(-1, rc);
children[i].fd = rc;
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));
}
}