Tcl Source Code

Check-in [61699305b8]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix botched patch
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-4-branch
Files: files | file ages | folders
SHA1: 61699305b8168a8f024d1aa99c93ee219a8f9ea2
User & Date: dkf 2012-11-14 16:30:27
Context
2012-11-14
22:05
3587242 Missing Tcl_MutexUnlock() call made [testasync create] block. check-in: df22be24ef user: dgp tags: core-8-4-branch
16:30
Fix botched patch check-in: 61699305b8 user: dkf tags: core-8-4-branch
14:29
Backport from Tcl 8.6. * unix/tclUnixPipe.c (DefaultTempDir): [Bug 2933003]: Allow overriding of t... check-in: dbb6880cd2 user: dkf tags: core-8-4-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to unix/tclUnixPipe.c.

14
15
16
17
18
19
20










21
22
23
24
25
26
27
#include "tclInt.h"
#include "tclPort.h"

#ifdef USE_VFORK
#define fork vfork
#endif











/*
 * The following macros convert between TclFile's and fd's.  The conversion
 * simple involves shifting fd's up by one to ensure that no valid fd is ever
 * the same as NULL.
 */

#define MakeFile(fd) ((TclFile)(((int)fd)+1))







>
>
>
>
>
>
>
>
>
>







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "tclInt.h"
#include "tclPort.h"

#ifdef USE_VFORK
#define fork vfork
#endif

/*
 * Fallback temporary file location the temporary file generation code. Can be
 * overridden at compile time for when it is known that temp files can't be
 * written to /tmp (hello, iOS!).
 */

#ifndef TCL_TEMPORARY_FILE_DIRECTORY
#define TCL_TEMPORARY_FILE_DIRECTORY	"/tmp"
#endif

/*
 * The following macros convert between TclFile's and fd's.  The conversion
 * simple involves shifting fd's up by one to ensure that no valid fd is ever
 * the same as NULL.
 */

#define MakeFile(fd) ((TclFile)(((int)fd)+1))
58
59
60
61
62
63
64

65
66
67
68
69
70
71
		    char *buf, int toRead, int *errorCode));
static int	PipeOutputProc _ANSI_ARGS_((
		    ClientData instanceData, CONST char *buf, int toWrite,
		    int *errorCode));
static void	PipeWatchProc _ANSI_ARGS_((ClientData instanceData, int mask));
static void	RestoreSignals _ANSI_ARGS_((void));
static int	SetupStdFile _ANSI_ARGS_((TclFile file, int type));


/*
 * This structure describes the channel type structure for command pipe
 * based IO:
 */

static Tcl_ChannelType pipeChannelType = {







>







68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
		    char *buf, int toRead, int *errorCode));
static int	PipeOutputProc _ANSI_ARGS_((
		    ClientData instanceData, CONST char *buf, int toWrite,
		    int *errorCode));
static void	PipeWatchProc _ANSI_ARGS_((ClientData instanceData, int mask));
static void	RestoreSignals _ANSI_ARGS_((void));
static int	SetupStdFile _ANSI_ARGS_((TclFile file, int type));
static CONST char * DefaultTempDir _ANSI_ARGS_((void));

/*
 * This structure describes the channel type structure for command pipe
 * based IO:
 */

static Tcl_ChannelType pipeChannelType = {
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
 * DefaultTempDir --
 *
 *	Helper that does *part* of what tempnam() does.
 *
 *----------------------------------------------------------------------
 */

static const char *
DefaultTempDir(void)
{
    const char *dir;
    struct stat buf;

    dir = getenv("TMPDIR");
    if (dir && dir[0] && stat(dir, &buf) == 0 && S_ISDIR(buf.st_mode)
	    && access(dir, W_OK)) {
	return dir;
    }







|


|







285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
 * DefaultTempDir --
 *
 *	Helper that does *part* of what tempnam() does.
 *
 *----------------------------------------------------------------------
 */

static CONST char *
DefaultTempDir(void)
{
    CONST char *dir;
    struct stat buf;

    dir = getenv("TMPDIR");
    if (dir && dir[0] && stat(dir, &buf) == 0 && S_ISDIR(buf.st_mode)
	    && access(dir, W_OK)) {
	return dir;
    }