* child_info.h (CURR_CHILD_INFO_MAGIC): Update.

(child_info::parent_wr_proc_pipe): Eliminate.
* pinfo.h (_pinfo::alert_parent): Move here from pinfo class.
(_pinfo::dup_proc_pipe): New method.
(_pinfo::sync_proc_pipe): Ditto.
* exceptions.cc (sig_handle_tty_stop): Reflect move of alert_parent.
* init.cc (dll_entry): Exit with status one if main process called ExitProcess.
* pinfo.cc (set_myself): Remove handling of parent_wr_proc_pipe.
(_pinfo::exit): Reflect move of alert_parent.  Set procinfo to NULL to flag
that we are exiting normally.  Always use exitcode when exiting
(although this could be a little racy).
(pinfo::init): Set default exit to SIGTERM.  This will be the exit code
reported if process is terminated.
(_pinfo::dup_proc_pipe): New function.
(pinfo::wait): Duplicate wr_proc_pipe to the right place.  Use dup_proc_pipe to
move the pipe to the child.
(_pinfo::sync_proc_pipe): New function.
(_pinfo::alert_parent): Move to _pinfo.  Make sure that wr_proc_pipe is ours
before using it.
* sigproc.cc (child_info::child_info): Remove handling of parent_wr_proc_pipe.
* spawn.cc (spawn_guts): Pass our wr_proc_pipe to the child when execing.
Ensure that exit code of cygwin process started from windows is correctly set.
This commit is contained in:
Christopher Faylor
2004-12-24 18:31:23 +00:00
parent 4697fbcd51
commit e1736c2f13
8 changed files with 121 additions and 66 deletions

View File

@@ -106,6 +106,9 @@ public:
bool alive ();
char *cmdline (size_t &);
void set_ctty (class tty_min *, int, class fhandler_tty_slave *);
bool dup_proc_pipe (HANDLE) __attribute__ ((regparm(2)));
void sync_proc_pipe ();
bool alert_parent (char);
friend void __stdcall set_myself (HANDLE);
@@ -117,6 +120,7 @@ private:
sigset_t sig_mask;
public:
HANDLE wr_proc_pipe;
DWORD wr_proc_pipe_owner;
friend class pinfo;
};
@@ -163,8 +167,6 @@ public:
operator _pinfo * () const {return procinfo;}
// operator bool () const {return (int) h;}
void preserve () { destroy = false; }
bool alert_parent (char);
bool parent_alive () { return alert_parent (__ALERT_ALIVE); }
#ifndef _SIGPROC_H
int remember () {system_printf ("remember is not here"); return 0;}
#else
@@ -178,6 +180,7 @@ public:
#endif
HANDLE shared_handle () {return h;}
void set_acl();
friend class _pinfo;
};
#define ISSTATE(p, f) (!!((p)->process_state & f))