* child_info.h (child_info_fork::handle_failure): Declare new function.
(child_info_fork::retry): New field. * dcrt0.cc (__api_fatal_exit_val): Define. (child_info_fork::handle_failure): Define new function. (__api_fatal): Exit using __api_fatal_exit_val value. * environ.cc (set_fork_retry): Set fork_retry based on CYGWIN environment variable. (parse_thing): Add "fork_retry" setting. * fork.cc (fork_retry): Define. (frok::parent): Reorganize to allow retry of failed child creation if child signalled that it was ok to do so. * heap.cc (heap_init): Signal parent via handle_failure when VirtualAlloc fails. * pinfo.h (EXITCODE_RETRY): Declare. * sigproc.cc (child_info::sync): Properly exit with failure condition if called for fork and didn't see subproc_ready. * spawn.cc (spawn_guts): Use windows pid as first argument. * winsup.h: Remove obsolete NEW_MACRO_VARARGS define. (__api_fatal_exit_val): Declare. (set_api_fatal_return): Define. (in_dllentry): Declare. * exceptions.cc (inside_kernel): Remove unneeded in_dllentry declaration.
This commit is contained in:
@@ -122,6 +122,7 @@ extern "C"
|
||||
#ifdef DEBUGGING
|
||||
int pinger;
|
||||
#endif
|
||||
int NO_COPY __api_fatal_exit_val = 1;
|
||||
};
|
||||
|
||||
char *old_title;
|
||||
@@ -640,6 +641,14 @@ get_cygwin_startup_info ()
|
||||
return res;
|
||||
}
|
||||
|
||||
bool
|
||||
child_info_fork::handle_failure (DWORD err)
|
||||
{
|
||||
if (retry > 0)
|
||||
ExitProcess (EXITCODE_RETRY);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define dll_data_start &_data_start__
|
||||
#define dll_data_end &_data_end__
|
||||
#define dll_bss_start &_bss_start__
|
||||
@@ -1157,7 +1166,7 @@ __api_fatal (const char *fmt, ...)
|
||||
#ifdef DEBUGGING
|
||||
try_to_debug ();
|
||||
#endif
|
||||
myself.exit (1);
|
||||
myself.exit (__api_fatal_exit_val);
|
||||
}
|
||||
|
||||
void
|
||||
|
Reference in New Issue
Block a user