mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-30 02:50:25 +08:00
* fhandler.h (fhandler_console::tc_getpgid): New function.
* spawn.cc (spawn_guts): Add logic to put pure-windows processes "in the background" when they are started that way.
This commit is contained in:
parent
c53c656b1c
commit
3d1dd0789e
@ -1,3 +1,10 @@
|
|||||||
|
2011-10-07 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
Christopher Faylor <me.cygwin2011@cgf.cx>
|
||||||
|
|
||||||
|
* fhandler.h (fhandler_console::tc_getpgid): New function.
|
||||||
|
* spawn.cc (spawn_guts): Add logic to put pure-windows processes "in
|
||||||
|
the background" when they are started that way.
|
||||||
|
|
||||||
2011-10-07 Corinna Vinschen <corinna@vinschen.de>
|
2011-10-07 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* include/sys/cygwin.h (cygwin_getinfo_types): Define values
|
* include/sys/cygwin.h (cygwin_getinfo_types): Define values
|
||||||
|
@ -1100,6 +1100,7 @@ private:
|
|||||||
tty_min *tc () const {return &(shared_console_info->tty_min_state);}
|
tty_min *tc () const {return &(shared_console_info->tty_min_state);}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
static pid_t tc_getpgid () {return shared_console_info->tty_min_state.getpgid ();}
|
||||||
fhandler_console (fh_devices);
|
fhandler_console (fh_devices);
|
||||||
static console_state *open_shared_console (HWND hw, HANDLE& h)
|
static console_state *open_shared_console (HWND hw, HANDLE& h)
|
||||||
{
|
{
|
||||||
|
@ -558,7 +558,17 @@ spawn_guts (const char *prog_arg, const char *const *argv,
|
|||||||
&& (!ch.iscygwin () || mode != _P_OVERLAY
|
&& (!ch.iscygwin () || mode != _P_OVERLAY
|
||||||
|| cygheap->fdtab.need_fixup_before ()))
|
|| cygheap->fdtab.need_fixup_before ()))
|
||||||
c_flags |= CREATE_SUSPENDED;
|
c_flags |= CREATE_SUSPENDED;
|
||||||
|
/* If a native application should be spawned, we test here if the spawning
|
||||||
|
process is running in a console and, if so, if it's a foreground or
|
||||||
|
background process. If it's a background process, we start the native
|
||||||
|
process with the CREATE_NEW_PROCESS_GROUP flag set. This lets the native
|
||||||
|
process ignore Ctrl-C by default. If we don't do that, pressing Ctrl-C
|
||||||
|
in a console will break native processes running in the background,
|
||||||
|
because the Ctrl-C event is sent to all processes in the console, unless
|
||||||
|
they ignore it explicitely. CREATE_NEW_PROCESS_GROUP does that for us. */
|
||||||
|
if (!ch.iscygwin () && myself->ctty >= 0 && iscons_dev (myself->ctty)
|
||||||
|
&& fhandler_console::tc_getpgid () != getpgrp ())
|
||||||
|
c_flags |= CREATE_NEW_PROCESS_GROUP;
|
||||||
ch.refresh_cygheap ();
|
ch.refresh_cygheap ();
|
||||||
/* When ruid != euid we create the new process under the current original
|
/* When ruid != euid we create the new process under the current original
|
||||||
account and impersonate in child, this way maintaining the different
|
account and impersonate in child, this way maintaining the different
|
||||||
|
Loading…
x
Reference in New Issue
Block a user