mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-03 15:38:22 +00:00
Make kprintf_test resistant to limbo
This commit is contained in:
parent
711bd095db
commit
a277170c9a
1 changed files with 7 additions and 4 deletions
|
@ -245,13 +245,16 @@ TEST(ksnprintf, fuzzTheUnbreakable) {
|
|||
|
||||
TEST(kprintf, testFailure_wontClobberErrnoAndBypassesSystemCallSupport) {
|
||||
int n;
|
||||
const char *s = 0;
|
||||
ASSERT_EQ(0, errno);
|
||||
EXPECT_SYS(0, 3, dup(2));
|
||||
EXPECT_SYS(0, 0, close(2));
|
||||
// <LIMBO>
|
||||
if (close(2)) _Exit(200);
|
||||
n = __syscount;
|
||||
EXPECT_EQ(n, __syscount);
|
||||
EXPECT_EQ(0, errno);
|
||||
EXPECT_SYS(0, 2, dup2(3, 2));
|
||||
if (__syscount != n) _Exit(201);
|
||||
if (errno != 0) _Exit(202);
|
||||
if (dup2(3, 2) != 2) _Exit(203);
|
||||
// </LIMBO>
|
||||
EXPECT_SYS(0, 0, close(3));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue