summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXInit.c
diff options
context:
space:
mode:
authorwolfsuit <wolfsuit>2005-03-09 19:40:50 (GMT)
committerwolfsuit <wolfsuit>2005-03-09 19:40:50 (GMT)
commit88040acda86230fe9cc4ebfef29321940976db05 (patch)
tree9d44f0e9e176ad5cda43cfb0cf279dfaf1d94da8 /macosx/tkMacOSXInit.c
parent72d7d96374d5a0dd032e725c1bd1279ca115c218 (diff)
downloadtk-88040acda86230fe9cc4ebfef29321940976db05.zip
tk-88040acda86230fe9cc4ebfef29321940976db05.tar.gz
tk-88040acda86230fe9cc4ebfef29321940976db05.tar.bz2
Add a hack to work around some issues with remote debugging with Xcode. Xcode requires
that stdin & stdout be closed or you won't be able to interrupt the running program. So I added a check for XCNOSTDIN environment variable in the startup, and I force them closed if it is set. With that, remote debugging works pretty well.
Diffstat (limited to 'macosx/tkMacOSXInit.c')
-rw-r--r--macosx/tkMacOSXInit.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index b7acd4f..3c20b5f 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXInit.c,v 1.7 2005/01/25 06:54:18 das Exp $
+ * RCS: @(#) $Id: tkMacOSXInit.c,v 1.8 2005/03/09 19:40:52 wolfsuit Exp $
*/
#include "tkInt.h"
@@ -167,6 +167,15 @@ TkpInit(interp)
* then use the Tk based console interpreter.
*/
+ /* REMOVE ME: Close stdin & stdout for remote debugging otherwise we
+ * will fight with gdb for stdin & stdout
+ */
+
+ if (getenv ("XCNOSTDIN") != NULL) {
+ close (0);
+ close (1);
+ }
+
if (!isatty(0)) {
struct stat st;
if (fstat(0, &st) || (S_ISCHR(st.st_mode) && st.st_blocks == 0)) {