Skip to content

Commit

Permalink
Show file descriptors on crash on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jart committed Sep 19, 2024
1 parent 87a6669 commit 8313dca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions libc/log/oncrash_amd64.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "libc/atomic.h"
#include "libc/calls/blockcancel.internal.h"
#include "libc/calls/calls.h"
#include "libc/calls/internal.h"
#include "libc/calls/state.internal.h"
#include "libc/calls/struct/sigaction.h"
#include "libc/calls/struct/siginfo.h"
Expand Down Expand Up @@ -242,6 +243,9 @@ static relegated void ShowCrashReport(int err, int sig, siginfo_t *si,
}
kprintf("\n");
__print_maps(15);
if (g_fds.n)
kprintf("\n");
__printfds(g_fds.p, g_fds.n);
if (__argv)
for (i = 0; i < __argc; ++i)
kprintf("%s ", __argv[i]);
Expand Down
1 change: 0 additions & 1 deletion libc/sock/getsockopt-nt.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ textwindows int sys_getsockopt_nt(struct Fd *fd, int level, int optname,
uint64_t ms;
uint32_t in_optlen;
struct linger_nt linger;
npassert(fd->kind == kFdSocket);

if (out_opt_optval && inout_optlen) {
in_optlen = *inout_optlen;
Expand Down

0 comments on commit 8313dca

Please sign in to comment.