Change use of BOOL, TRUE, FALSE to bool, true, false, as appropriate,

throughout.
* tty.cc (tty::common_init): Remove call to SetKernelObjectSecurity and edit
some comments.
* cygheap.h (init_cygheap::ctty): Add new element.
* devices.in (device::parse): Remove special handling for /dev/tty.
* devices.cc: Regenerate.
* dtable.cc (build_fh_pc): Don't reset /dev/tty device.  Let the device opener
do that.
* fhandler_termios.cc (tty_min::set_ctty): Redefine to _pinfo class.
* fhandler_tty.cc (fhandler_tty_common::set_close_on_exec): Avoid setting
noninherit flag for ctty.
* tty.h: Move BOOLs to bools.
(tty_min::set_ctty): Redeclare to _pinfo class.
* pinfo.cc (_pinfo::set_ctty): Define new function based on tty_min::set_ctty.
Change first argument from tty number to tty_min class.
* pinfo.h (_pinfo::set_ctty): Declare.
* fhandler_console.cc (fhandler_console::get_tty_stuff): Reflect move of
set_ctty to _pinfo class.
* fhandler_tty.cc (fhandler_tty_slave::open): Treat FH_TTY specially.  Use
saved cygheap value if it exists.  Otherwise convert to real device and save on
first time open.
(fhandler_tty_common::dup): Potentially set controlling tty if duping a slave
tty.
* syscalls.cc (setsid): Close controlling tty in cygheap.
* tty.cc: Change some BOOLs to bools.
This commit is contained in:
Christopher Faylor
2003-12-07 22:37:12 +00:00
parent 2e3ff06d3c
commit 2e008fb91f
41 changed files with 425 additions and 384 deletions

View File

@ -163,7 +163,7 @@ DWORD NO_COPY sigtid = 0; // ID of the signal thread
/* Functions
*/
static int __stdcall checkstate (waitq *) __attribute__ ((regparm (1)));
static __inline__ BOOL get_proc_lock (DWORD, DWORD);
static __inline__ bool get_proc_lock (DWORD, DWORD);
static void __stdcall remove_zombie (int);
static DWORD WINAPI wait_sig (VOID *arg);
static int __stdcall stopped_or_terminated (waitq *, _pinfo *);
@ -172,14 +172,14 @@ static DWORD WINAPI wait_subproc (VOID *);
/* Determine if the parent process is alive.
*/
BOOL __stdcall
bool __stdcall
my_parent_is_alive ()
{
DWORD res;
bool res;
if (!myself->ppid_handle)
{
debug_printf ("No myself->ppid_handle");
res = FALSE;
res = false;
}
else
for (int i = 0; i < 2; i++)
@ -187,11 +187,11 @@ my_parent_is_alive ()
{
case WAIT_OBJECT_0:
debug_printf ("parent dead.");
res = FALSE;
res = false;
goto out;
case WAIT_TIMEOUT:
debug_printf ("parent still alive");
res = TRUE;
res = true;
goto out;
case WAIT_FAILED:
DWORD werr = GetLastError ();
@ -199,7 +199,7 @@ my_parent_is_alive ()
continue;
system_printf ("WFSO for myself->ppid_handle(%p) failed, error %d",
myself->ppid_handle, werr);
res = FALSE;
res = false;
goto out;
}
out:
@ -221,31 +221,31 @@ wait_for_sigthread ()
* Attempt to handle case where process is exiting as we try to grab
* the mutex.
*/
static BOOL
static bool
get_proc_lock (DWORD what, DWORD val)
{
Static int lastwhat = -1;
if (!sync_proc_subproc)
return FALSE;
return false;
if (sync_proc_subproc->acquire (WPSP))
{
lastwhat = what;
return TRUE;
return true;
}
if (!sync_proc_subproc)
return FALSE;
return false;
system_printf ("Couldn't aquire sync_proc_subproc for(%d,%d), %E, last %d",
what, val, lastwhat);
return TRUE;
return true;
}
static BOOL __stdcall
static bool __stdcall
proc_can_be_signalled (_pinfo *p)
{
if (p == myself_nowait || p == myself)
{
assert (!wait_sig_inited);
return 1;
return true;
}
return ISSTATE (p, PID_INITIALIZING) ||
@ -253,7 +253,7 @@ proc_can_be_signalled (_pinfo *p)
(PID_ACTIVE | PID_IN_USE));
}
BOOL __stdcall
bool __stdcall
pid_exists (pid_t pid)
{
pinfo p (pid);
@ -262,7 +262,7 @@ pid_exists (pid_t pid)
/* Test to determine if a process really exists and is processing signals.
*/
BOOL __stdcall
bool __stdcall
proc_exists (_pinfo *p)
{
return p && !(p->process_state & (PID_EXITED | PID_ZOMBIE));
@ -654,7 +654,7 @@ int __stdcall
sig_send (_pinfo *p, int sig, void *tls)
{
int rc = 1;
BOOL its_me;
bool its_me;
HANDLE sendsig;
sigpacket pack;
@ -925,7 +925,7 @@ stopped_or_terminated (waitq *parent_w, _pinfo *child)
if (!potential_match)
return 0;
BOOL terminated;
bool terminated;
if ((terminated = child->process_state == PID_ZOMBIE) ||
((w->options & WUNTRACED) && child->stopsig))