diff options
author | hobbs <hobbs> | 2007-04-21 19:06:37 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2007-04-21 19:06:37 (GMT) |
commit | fc87f3751a9393132d24550de1637785b4aac5e5 (patch) | |
tree | 67b15fa8aaeefba792a30cace3d1ecf46d134365 /macosx/tkMacOSXInit.c | |
parent | 85f6905c50918a0ff282d5897620c1768a2e326d (diff) | |
download | tk-fc87f3751a9393132d24550de1637785b4aac5e5.zip tk-fc87f3751a9393132d24550de1637785b4aac5e5.tar.gz tk-fc87f3751a9393132d24550de1637785b4aac5e5.tar.bz2 |
* macosx/tkMacOSXBitmap.c, macosx/tkMacOSXButton.c:
* macosx/tkMacOSXCarbonEvents.c, macosx/tkMacOSXClipboard.c:
* macosx/tkMacOSXCursor.c, macosx/tkMacOSXDialog.c:
* macosx/tkMacOSXDraw.c, macosx/tkMacOSXEvent.c:
* macosx/tkMacOSXFont.c, macosx/tkMacOSXInit.c, macosx/tkMacOSXInt.h:
* macosx/tkMacOSXKeyEvent.c, macosx/tkMacOSXMenu.c:
* macosx/tkMacOSXMenubutton.c, macosx/tkMacOSXMouseEvent.c:
* macosx/tkMacOSXScale.c, macosx/tkMacOSXWindowEvent.c:
* macosx/tkMacOSXWm.c: Revert of commits from 2007-04-13 which
broke the OS X build.
Diffstat (limited to 'macosx/tkMacOSXInit.c')
-rw-r--r-- | macosx/tkMacOSXInit.c | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index 6059708..cde0be8 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -11,7 +11,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.26 2007/04/13 14:51:18 dkf Exp $ + * RCS: @(#) $Id: tkMacOSXInit.c,v 1.27 2007/04/21 19:06:38 hobbs Exp $ */ #include "tkMacOSXInt.h" @@ -198,29 +198,22 @@ TkpInit(interp) FSRef ref; SInt16 refNum; - /* - * Write resource data to temporary file and open it. - */ - + /* Write resource data to temporary file and open it */ strcpy(fileName, P_tmpdir); if (fileName[strlen(fileName) - 1] != '/') { strcat(fileName, "/"); } strcat(fileName, "tkMacOSX_XXXXXX"); fd = mkstemp(fileName); - if (fd == -1) { - break; - } + if (fd == -1) break; fcntl(fd, F_SETFD, FD_CLOEXEC); - if (write(fd, data, size) == -1) { - break; - } + if (write(fd, data, size) == -1) break; err = FSPathMakeRef((unsigned char*)fileName, &ref, NULL); - if (err != noErr) { - break; - } + if (err != noErr) break; err = FSOpenResourceFile(&ref, 0, NULL, fsRdPerm, &refNum); - LOG_ON_ERROR(FSOpenResourceFile); +#ifdef TK_MAC_DEBUG + if (err != noErr) fprintf(stderr,"FSOpenResourceFile error %ld\n",err); +#endif break; } if (fd != -1) { @@ -232,11 +225,12 @@ TkpInit(interp) } /* REMOVE ME: Close stdin & stdout for remote debugging otherwise we - * will fight with gdb for stdin & stdout */ + * will fight with gdb for stdin & stdout + */ - if (getenv("XCNOSTDIN") != NULL) { - close(0); - close(1); + if (getenv ("XCNOSTDIN") != NULL) { + close (0); + close (1); } /* @@ -247,22 +241,18 @@ TkpInit(interp) if (!isatty(0)) { struct stat st; - if (fstat(0, &st) || (S_ISCHR(st.st_mode) && st.st_blocks == 0)) { Tk_InitConsoleChannels(interp); Tcl_RegisterChannel(interp, Tcl_GetStdChannel(TCL_STDIN)); Tcl_RegisterChannel(interp, Tcl_GetStdChannel(TCL_STDOUT)); Tcl_RegisterChannel(interp, Tcl_GetStdChannel(TCL_STDERR)); - /* - * Only show the console if we don't have a startup script and - * tcl_interactive hasn't been set already. + * Only show the console if we don't have a startup script + * and tcl_interactive hasn't been set already. */ - if (Tcl_GetStartupScript(NULL) == NULL) { - CONST char *intvar = Tcl_GetVar(interp, - "tcl_interactive", TCL_GLOBAL_ONLY); - + CONST char *intvar = + Tcl_GetVar(interp, "tcl_interactive", TCL_GLOBAL_ONLY); if (intvar == NULL) { Tcl_SetVar(interp, "tcl_interactive", "1", TCL_GLOBAL_ONLY); |