* pinfo.h (_pinfo::set_exit_state): Declare new function.
(pinfo::exit): Move here from _pinfo::exit. * sigproc.cc (child_info::sync): Use new function to set exitcode and process_state. * pinfo.cc (_pinfo::exit): Ditto. (proc_waiter): Ditto. (_pinfo::set_exit_state): Define new function. (_pinfo::dup_proc_pipe): Close handle when there is no parent process around to care about the exit value. * dcrt0.cc (dll_crt0_0): Move subproc_ready synchronization later to make sure that myself is still mapped in parent. (do_exit): Reflect movement to pinfo::exit. (__api_fatal): Ditto. * exceptions.cc (signal_exit): Ditto. * errno.cc (errmap): Map PROC_NOT_FOUND. * init.cc (dll_entry): Release myself before exiting. * sigproc.cc (proc_can_be_signalled): Set errno appropriately. (sig_send): Ditto. Also remove ill-advised test for !myself->sendsig since this is an indication of a process which is still initializating -- it is not an error. (child_info::sync): Don't set exitcode here. Assume that will happen in proc_waiter, if necessary. * spawn.cc (spawn_guts): Delay "wait_for_myself" logic until later. Don't wait at all if the process has already exited. Reflect movement to pinfo::exit.
This commit is contained in:
@@ -27,6 +27,8 @@ enum picom
|
||||
};
|
||||
|
||||
#define EXITCODE_UNSET 0x80000000
|
||||
#define EXITCODE_NOSET EXITCODE_UNSET
|
||||
#define EXITCODE_EXEC EXITCODE_UNSET
|
||||
|
||||
class _pinfo
|
||||
{
|
||||
@@ -83,8 +85,6 @@ public:
|
||||
HANDLE tothem;
|
||||
HANDLE fromthem;
|
||||
|
||||
void exit (UINT n, bool norecord = 0) __attribute__ ((noreturn, regparm(2)));
|
||||
|
||||
inline void set_has_pgid_children ()
|
||||
{
|
||||
if (pgid == pid)
|
||||
@@ -155,6 +155,8 @@ public:
|
||||
if (destroy && procinfo)
|
||||
release ();
|
||||
}
|
||||
void exit (DWORD n) __attribute__ ((noreturn, regparm(2)));
|
||||
void set_exit_state (DWORD) __attribute__ ((regparm(2)));
|
||||
void initialize_lock () {InitializeCriticalSection (&_lock);}
|
||||
void lock () {EnterCriticalSection (&_lock);}
|
||||
void unlock () {LeaveCriticalSection (&_lock);}
|
||||
|
Reference in New Issue
Block a user