Skip to content

Commit 8313dca

Browse files
committed
Show file descriptors on crash on Windows
1 parent 87a6669 commit 8313dca

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

libc/log/oncrash_amd64.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "libc/atomic.h"
2121
#include "libc/calls/blockcancel.internal.h"
2222
#include "libc/calls/calls.h"
23+
#include "libc/calls/internal.h"
2324
#include "libc/calls/state.internal.h"
2425
#include "libc/calls/struct/sigaction.h"
2526
#include "libc/calls/struct/siginfo.h"
@@ -242,6 +243,9 @@ static relegated void ShowCrashReport(int err, int sig, siginfo_t *si,
242243
}
243244
kprintf("\n");
244245
__print_maps(15);
246+
if (g_fds.n)
247+
kprintf("\n");
248+
__printfds(g_fds.p, g_fds.n);
245249
if (__argv)
246250
for (i = 0; i < __argc; ++i)
247251
kprintf("%s ", __argv[i]);

libc/sock/getsockopt-nt.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ textwindows int sys_getsockopt_nt(struct Fd *fd, int level, int optname,
3939
uint64_t ms;
4040
uint32_t in_optlen;
4141
struct linger_nt linger;
42-
npassert(fd->kind == kFdSocket);
4342

4443
if (out_opt_optval && inout_optlen) {
4544
in_optlen = *inout_optlen;

0 commit comments

Comments
 (0)