aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2012-04-15 17:51:22 +0000
committerChristopher Faylor <me@cgf.cx>2012-04-15 17:51:22 +0000
commitaba77cbe8fddb0c1d9d544eee03aa95faf180c01 (patch)
treec33ce1d5fe9ce2a1d59cc4fbc59f0f87a4849dd1 /winsup
parent0a3819e6558be56d5846fe38ff3a48bc88c8fd91 (diff)
downloadnewlib-aba77cbe8fddb0c1d9d544eee03aa95faf180c01.zip
newlib-aba77cbe8fddb0c1d9d544eee03aa95faf180c01.tar.gz
newlib-aba77cbe8fddb0c1d9d544eee03aa95faf180c01.tar.bz2
wincap.h: Rename assitant to assistant throughout. wincap.cc: Ditto.
* devices.in (exists_console): Use fhandler_console::exists () rather than raw test. * devices.cc: Regenerate. * fhandler.h (fhandler_console::exists): Define new function. * fhandler_console.cc (fhandler_console::need_invisible): Use fhandler_console::exists () rather than raw test. * spawn.cc: Rename assitant to assistant throughout. (child_info_spawn::worker): Simplify test for when to start a non-Cygwin process in its own process group. Just do it whenever we start a non-Cygwin process.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog15
-rw-r--r--winsup/cygwin/devices.cc5
-rw-r--r--winsup/cygwin/devices.in5
-rw-r--r--winsup/cygwin/fhandler.h1
-rw-r--r--winsup/cygwin/fhandler_console.cc2
-rw-r--r--winsup/cygwin/spawn.cc16
-rw-r--r--winsup/cygwin/wincap.cc16
-rw-r--r--winsup/cygwin/wincap.h4
8 files changed, 40 insertions, 24 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index b5dbd7b..6e8b5b5 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,18 @@
+2012-04-15 Christopher Faylor <me.cygwin2012@cgf.cx>
+
+ wincap.h: Rename assitant to assistant throughout.
+ wincap.cc: Ditto.
+ * devices.in (exists_console): Use fhandler_console::exists () rather
+ than raw test.
+ * devices.cc: Regenerate.
+ * fhandler.h (fhandler_console::exists): Define new function.
+ * fhandler_console.cc (fhandler_console::need_invisible): Use
+ fhandler_console::exists () rather than raw test.
+ * spawn.cc: Rename assitant to assistant throughout.
+ (child_info_spawn::worker): Simplify test for when to start a
+ non-Cygwin process in its own process group. Just do it whenever we
+ start a non-Cygwin process.
+
2012-04-12 Christopher Faylor <me.cygwin2012@cgf.cx>
* devices.in (exists_console): Allow /dev/con{sole,in,out} to be
diff --git a/winsup/cygwin/devices.cc b/winsup/cygwin/devices.cc
index d67bcf4..9c8a0d0 100644
--- a/winsup/cygwin/devices.cc
+++ b/winsup/cygwin/devices.cc
@@ -6,7 +6,10 @@
#include "tty.h"
#include "pinfo.h"
#include "shared_info.h"
+#include "path.h"
+#include "fhandler.h"
#include "ntdll.h"
+
typedef const device *KR_device_t;
@@ -73,7 +76,7 @@ exists_console (const device& dev)
case FH_CONSOLE:
case FH_CONIN:
case FH_CONOUT:
- return !!GetConsoleCP ();
+ return fhandler_console::exists ();
default:
/* Only show my own console device (for now?) */
return iscons_dev (myself->ctty) && myself->ctty == devn;
diff --git a/winsup/cygwin/devices.in b/winsup/cygwin/devices.in
index b656886..09a1f7d 100644
--- a/winsup/cygwin/devices.in
+++ b/winsup/cygwin/devices.in
@@ -5,7 +5,10 @@
#include "tty.h"
#include "pinfo.h"
#include "shared_info.h"
+#include "path.h"
+#include "fhandler.h"
#include "ntdll.h"
+
typedef const device *KR_device_t;
}
%type KR_device_t
@@ -69,7 +72,7 @@ exists_console (const device& dev)
case FH_CONSOLE:
case FH_CONIN:
case FH_CONOUT:
- return !!GetConsoleCP ();
+ return fhandler_console::exists ();
default:
/* Only show my own console device (for now?) */
return iscons_dev (myself->ctty) && myself->ctty == devn;
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index 84d5314..20b9139 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -1377,6 +1377,7 @@ private:
ssize_t __stdcall write (const void *ptr, size_t len);
void doecho (const void *str, DWORD len) { (void) write (str, len); }
int close ();
+ static bool exists () {return !!GetConsoleCP ();}
int tcflush (int);
int tcsetattr (int a, const struct termios *t);
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index d2e993f..8c75653 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -2371,7 +2371,7 @@ bool
fhandler_console::need_invisible ()
{
BOOL b = false;
- if (GetConsoleCP ())
+ if (exists ())
invisible_console = false;
else
{
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index c05c7af..d296597 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -453,7 +453,7 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
c_flags |= CREATE_SEPARATE_WOW_VDM | CREATE_UNICODE_ENVIRONMENT;
- if (wincap.has_program_compatibility_assitant ())
+ if (wincap.has_program_compatibility_assistant ())
{
/* We're adding the CREATE_BREAKAWAY_FROM_JOB flag here to workaround
issues with the "Program Compatibility Assistant (PCA) Service"
@@ -599,16 +599,10 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
&& (!iscygwin () || mode != _P_OVERLAY
|| ::cygheap->fdtab.need_fixup_before ()))
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 (!iscygwin () && myself->ctty >= 0 && iscons_dev (myself->ctty)
- && fhandler_console::tc_getpgid () != myself->pgid)
+ /* Give non-Cygwin processes their own process group since they will be
+ dealing with CTRL-C themselves. Not sure if this is correct for spawn*()
+ or not though. */
+ if (!iscygwin () && fhandler_console::exists ())
c_flags |= CREATE_NEW_PROCESS_GROUP;
refresh_cygheap ();
diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc
index 6fe172f..495e3a3 100644
--- a/winsup/cygwin/wincap.cc
+++ b/winsup/cygwin/wincap.cc
@@ -53,7 +53,7 @@ wincaps wincap_2000 __attribute__((section (".cygwin_dll_common"), shared)) = {
has_stack_size_param_is_a_reservation:false,
has_console_logon_sid:false,
wow64_has_secondary_stack:false,
- has_program_compatibility_assitant:false,
+ has_program_compatibility_assistant:false,
kernel_is_always_casesensitive:true,
};
@@ -87,7 +87,7 @@ wincaps wincap_2000sp4 __attribute__((section (".cygwin_dll_common"), shared)) =
has_stack_size_param_is_a_reservation:false,
has_console_logon_sid:false,
wow64_has_secondary_stack:false,
- has_program_compatibility_assitant:false,
+ has_program_compatibility_assistant:false,
kernel_is_always_casesensitive:true,
};
@@ -121,7 +121,7 @@ wincaps wincap_xp __attribute__((section (".cygwin_dll_common"), shared)) = {
has_stack_size_param_is_a_reservation:true,
has_console_logon_sid:false,
wow64_has_secondary_stack:false,
- has_program_compatibility_assitant:false,
+ has_program_compatibility_assistant:false,
kernel_is_always_casesensitive:false,
};
@@ -155,7 +155,7 @@ wincaps wincap_xpsp1 __attribute__((section (".cygwin_dll_common"), shared)) = {
has_stack_size_param_is_a_reservation:true,
has_console_logon_sid:false,
wow64_has_secondary_stack:false,
- has_program_compatibility_assitant:false,
+ has_program_compatibility_assistant:false,
kernel_is_always_casesensitive:false,
};
@@ -189,7 +189,7 @@ wincaps wincap_xpsp2 __attribute__((section (".cygwin_dll_common"), shared)) = {
has_stack_size_param_is_a_reservation:true,
has_console_logon_sid:false,
wow64_has_secondary_stack:false,
- has_program_compatibility_assitant:false,
+ has_program_compatibility_assistant:false,
kernel_is_always_casesensitive:false,
};
@@ -223,7 +223,7 @@ wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = {
has_stack_size_param_is_a_reservation:true,
has_console_logon_sid:false,
wow64_has_secondary_stack:true,
- has_program_compatibility_assitant:false,
+ has_program_compatibility_assistant:false,
kernel_is_always_casesensitive:false,
};
@@ -257,7 +257,7 @@ wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = {
has_stack_size_param_is_a_reservation:true,
has_console_logon_sid:false,
wow64_has_secondary_stack:false,
- has_program_compatibility_assitant:true,
+ has_program_compatibility_assistant:true,
kernel_is_always_casesensitive:false,
};
@@ -291,7 +291,7 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = {
has_stack_size_param_is_a_reservation:true,
has_console_logon_sid:true,
wow64_has_secondary_stack:false,
- has_program_compatibility_assitant:true,
+ has_program_compatibility_assistant:true,
kernel_is_always_casesensitive:false,
};
diff --git a/winsup/cygwin/wincap.h b/winsup/cygwin/wincap.h
index 3ca5d87..f22c194 100644
--- a/winsup/cygwin/wincap.h
+++ b/winsup/cygwin/wincap.h
@@ -43,7 +43,7 @@ struct wincaps
unsigned has_stack_size_param_is_a_reservation : 1;
unsigned has_console_logon_sid : 1;
unsigned wow64_has_secondary_stack : 1;
- unsigned has_program_compatibility_assitant : 1;
+ unsigned has_program_compatibility_assistant : 1;
unsigned kernel_is_always_casesensitive : 1;
};
@@ -96,7 +96,7 @@ public:
bool IMPLEMENT (has_stack_size_param_is_a_reservation)
bool IMPLEMENT (has_console_logon_sid)
bool IMPLEMENT (wow64_has_secondary_stack)
- bool IMPLEMENT (has_program_compatibility_assitant)
+ bool IMPLEMENT (has_program_compatibility_assistant)
bool IMPLEMENT (kernel_is_always_casesensitive)
#undef IMPLEMENT