From b706c6b479422d31f0124b92c21b4cb536bbddff Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 23 Aug 2017 17:43:41 +0200 Subject: [PATCH] cygwin: only expose /dev/con{in,out,sole} when started from a Windows console Signed-off-by: Corinna Vinschen --- winsup/cygwin/fhandler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 153e3847f..cd73e6e87 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -1439,7 +1439,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 ();} + static bool exists () {return shared_console_info && !!GetConsoleCP ();} int tcflush (int); int tcsetattr (int a, const struct termios *t);