2000-01-16 06:10:49 -05:00
|
|
|
|
--- tcl/tclCmdAH.c.orig Sun Jan 16 05:55:47 2000
|
|
|
|
|
+++ tcl/tclCmdAH.c Sun Jan 16 06:01:42 2000
|
|
|
|
|
@@ -38,9 +38,17 @@
|
2000-01-16 04:26:46 -05:00
|
|
|
|
#include <sys/wait.h>
|
|
|
|
|
#include "tclInt.h"
|
|
|
|
|
|
|
|
|
|
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
|
|
|
|
|
+#include <sys/param.h>
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
extern int errno;
|
|
|
|
|
+#if !(defined(BSD) && BSD >= 199306)
|
|
|
|
|
extern long lseek();
|
2000-01-16 06:10:49 -05:00
|
|
|
|
+#endif
|
|
|
|
|
+#ifndef BSD4_4
|
|
|
|
|
extern char *mktemp();
|
2000-01-16 04:26:46 -05:00
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*----------------------------------------------------------------------
|
2000-01-16 06:10:49 -05:00
|
|
|
|
@@ -430,7 +438,7 @@
|
|
|
|
|
int pid = -1; /* -1 means child process doesn't
|
|
|
|
|
* exist (yet). Non-zero gives its
|
|
|
|
|
* id (0 only in child). */
|
|
|
|
|
- union wait status;
|
|
|
|
|
+ int status;
|
|
|
|
|
char *cmdName, *execName;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
@@ -501,8 +509,13 @@
|
2000-01-16 04:26:46 -05:00
|
|
|
|
} else {
|
|
|
|
|
char tmp[sizeof(TMP_FILE_NAME) + 1];
|
|
|
|
|
strcpy(tmp, TMP_FILE_NAME);
|
2000-01-16 06:10:49 -05:00
|
|
|
|
+#ifdef BSD4_4
|
|
|
|
|
+ mkstemp(tmp);
|
2000-01-16 04:26:46 -05:00
|
|
|
|
+ stdIn[0] = mkstemp(tmp);
|
2000-01-16 06:10:49 -05:00
|
|
|
|
+#else
|
|
|
|
|
mktemp(tmp);
|
|
|
|
|
stdIn[0] = open(tmp, O_RDWR|O_CREAT, 0);
|
|
|
|
|
+#endif
|
2000-01-16 04:26:46 -05:00
|
|
|
|
if (stdIn[0] < 0) {
|
|
|
|
|
sprintf(interp->result,
|
|
|
|
|
"couldn't create input file for \"%.50s\" command: %.50s",
|
2000-01-16 06:10:49 -05:00
|
|
|
|
@@ -642,7 +655,7 @@
|
|
|
|
|
sprintf(interp->result, "command terminated abnormally");
|
|
|
|
|
result = TCL_ERROR;
|
|
|
|
|
}
|
|
|
|
|
- result = status.w_retcode;
|
|
|
|
|
+ result = WEXITSTATUS(status);
|
|
|
|
|
}
|
|
|
|
|
if (stdIn[0] != -1) {
|
|
|
|
|
close(stdIn[0]);
|