* fhandler.h (fhandler_pipe::fixup_in_child): Declare new function.
(fhandler_console::invisible_console): Declare new variable. (fhandler_console::need_invisible): Ditto. (fhandler_console::has_a): Ditto. * fhandler_console.cc (set_console_state_for_spawn): Eliminate return value. Set up an invisible console if necessary prior to spawning. (fhandler_console::invisible_console): Define. * fhandler_tty.cc (fhandler_tty_slave::open): Use fhandler_console::invisible_console to setup an invisible console. * pipe.cc (fhandler_pipe::fixup_in_child): Define new function from fixup_after_exec. (fhandler_pipe::fixup_after_exec): Use fixup_in_child when appropriate. (fhandler_pipe::fixup_after_fork): Ditto. * spawn.cc (handle): Reorganize and modernize a little. (spawn_guts): Rely on set_console_state_for_spawn to set the console into the right state but don't create the process with "detached" flag if we have no controlling tty since that confuses 'cmd'. * dtable.cc (dtable::stdio_init): Don't set console as controlling terminal if we have an invisible console. * sigproc.cc (child_info::sync): Use correct name in ForceCloseHandle1.
This commit is contained in:
@@ -515,6 +515,7 @@ public:
|
||||
void create_guard (SECURITY_ATTRIBUTES *sa) {guard = CreateMutex (sa, FALSE, NULL);}
|
||||
int dup (fhandler_base *child);
|
||||
int ioctl (unsigned int cmd, void *);
|
||||
void fixup_in_child ();
|
||||
virtual void fixup_after_fork (HANDLE);
|
||||
void fixup_after_exec ();
|
||||
bool hit_eof ();
|
||||
@@ -864,6 +865,7 @@ class fhandler_console: public fhandler_termios
|
||||
{
|
||||
private:
|
||||
static dev_console *dev_state;
|
||||
static bool invisible_console;
|
||||
|
||||
/* Output calls */
|
||||
void set_default_attr ();
|
||||
@@ -917,6 +919,8 @@ class fhandler_console: public fhandler_termios
|
||||
void send_winch_maybe ();
|
||||
static tty_min *get_tty_stuff (int);
|
||||
bool is_slow () {return 1;}
|
||||
static bool need_invisible ();
|
||||
static bool fhandler_console::has_a () {return !invisible_console;}
|
||||
};
|
||||
|
||||
class fhandler_tty_common: public fhandler_termios
|
||||
@@ -1360,6 +1364,6 @@ class select_stuff
|
||||
device_specific_mailslot (0) {}
|
||||
};
|
||||
|
||||
int __stdcall set_console_state_for_spawn ();
|
||||
void __stdcall set_console_state_for_spawn ();
|
||||
|
||||
#endif /* _FHANDLER_H_ */
|
||||
|
Reference in New Issue
Block a user