mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-08 20:28:30 +00:00
Fix close(1) bug on Windows
This commit is contained in:
parent
83341a4269
commit
b0e3258709
6 changed files with 51 additions and 7 deletions
|
@ -44,20 +44,20 @@ unsigned __wincrash(struct NtExceptionPointers *ep) {
|
|||
static bool noreentry;
|
||||
noreentry = true;
|
||||
|
||||
STRACE("wincrash rip %x bt %s", ep->ContextRecord->Rip,
|
||||
DescribeBacktrace((struct StackFrame *)ep->ContextRecord->Rbp));
|
||||
|
||||
if ((tib = __tls_enabled ? __get_tls_privileged() : 0)) {
|
||||
if (~tib->tib_flags & TIB_FLAG_WINCRASHING) {
|
||||
tib->tib_flags |= TIB_FLAG_WINCRASHING;
|
||||
} else {
|
||||
WincrashPanic:
|
||||
STRACE("panic: wincrash reentry: rip %x bt %s", ep->ContextRecord->Rip,
|
||||
DescribeBacktrace((struct StackFrame *)ep->ContextRecord->Rbp));
|
||||
ExitProcess(89);
|
||||
}
|
||||
} else {
|
||||
if (!noreentry) {
|
||||
noreentry = true;
|
||||
} else {
|
||||
goto WincrashPanic;
|
||||
ExitProcess(89);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue