mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Fix some bugs
This commit is contained in:
parent
363d2ec436
commit
2aebda7718
7 changed files with 63 additions and 60 deletions
|
@ -112,6 +112,7 @@ char *GetProgramExecutableName(void) {
|
|||
program_executable_name,
|
||||
program_executable_name + sizeof(program_executable_name));
|
||||
errno = e;
|
||||
once = true;
|
||||
}
|
||||
return program_executable_name;
|
||||
}
|
||||
|
|
|
@ -16,11 +16,14 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/dce.h"
|
||||
#include "libc/macros.internal.h"
|
||||
|
||||
.init.start 300,_init_wincrash
|
||||
#if !IsTiny()
|
||||
mov __wincrashearly(%rip),%rcx
|
||||
ntcall __imp_RemoveVectoredExceptionHandler
|
||||
#endif
|
||||
pushpop 1,%rcx
|
||||
ezlea __wincrash_nt,dx
|
||||
ntcall __imp_AddVectoredExceptionHandler
|
||||
|
|
|
@ -227,7 +227,9 @@ textwindows void WinMainForked(void) {
|
|||
|
||||
// restore the crash reporting stuff
|
||||
if (weaken(__wincrash_nt)) {
|
||||
RemoveVectoredExceptionHandler(__wincrashearly);
|
||||
if (!IsTiny()) {
|
||||
RemoveVectoredExceptionHandler(__wincrashearly);
|
||||
}
|
||||
AddVectoredExceptionHandler(1, (void *)weaken(__wincrash_nt));
|
||||
}
|
||||
if (weaken(__onntconsoleevent_nt)) {
|
||||
|
|
|
@ -268,7 +268,9 @@ __msabi textwindows int64_t WinMain(int64_t hInstance, int64_t hPrevInstance,
|
|||
os = WINDOWS; /* madness https://news.ycombinator.com/item?id=21019722 */
|
||||
ts = rdtsc();
|
||||
__pid = GetCurrentProcessId();
|
||||
#if !IsTiny()
|
||||
__wincrashearly = AddVectoredExceptionHandler(1, (void *)OnEarlyWinCrash);
|
||||
#endif
|
||||
cmdline = GetCommandLine();
|
||||
#ifdef SYSDEBUG
|
||||
/* sloppy flag-only check for early initialization */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue