better patches

This commit is contained in:
brad 2000-01-16 11:10:49 +00:00
parent 4ef282ff0c
commit 493b97252c
2 changed files with 42 additions and 25 deletions

View File

@ -1,6 +1,6 @@
--- tcl/tclCmdAH.c.orig Sun Jan 16 01:41:46 2000
+++ tcl/tclCmdAH.c Sun Jan 16 01:41:22 2000
@@ -38,9 +38,14 @@
--- 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 @@
#include <sys/wait.h>
#include "tclInt.h"
@ -11,27 +11,42 @@
extern int errno;
+#if !(defined(BSD) && BSD >= 199306)
extern long lseek();
-extern char *mktemp();
+#endif
+#ifndef BSD4_4
extern char *mktemp();
+#endif
/*
*----------------------------------------------------------------------
@@ -501,8 +506,7 @@
@@ -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 @@
} else {
char tmp[sizeof(TMP_FILE_NAME) + 1];
strcpy(tmp, TMP_FILE_NAME);
- mktemp(tmp);
- stdIn[0] = open(tmp, O_RDWR|O_CREAT, 0);
+#ifdef BSD4_4
+ mkstemp(tmp);
+ stdIn[0] = mkstemp(tmp);
+#else
mktemp(tmp);
stdIn[0] = open(tmp, O_RDWR|O_CREAT, 0);
+#endif
if (stdIn[0] < 0) {
sprintf(interp->result,
"couldn't create input file for \"%.50s\" command: %.50s",
@@ -627,7 +631,7 @@
while (1) {
int child;
- child = wait(&status);
+ child = wait((int *)&status);
if (child == -1) {
sprintf(interp->result,
"child process disappeared mysteriously");
@@ -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]);

View File

@ -1,13 +1,15 @@
--- icb/c_shell.c.orig Fri Feb 24 16:20:19 1995
+++ icb/c_shell.c Sun Jan 16 01:48:38 2000
@@ -60,13 +60,13 @@
signal(SIGQUIT, SIG_IGN);
/* wait for the child(ren) to die */
- while ((w = wait(&status)) != pid && w != -1);
+ while ((w = wait((int *)&status)) != pid && w != -1);
/* restore the terminal */
+++ icb/c_shell.c Sun Jan 16 05:08:31 2000
@@ -14,7 +14,7 @@
static char *usage = "usage: c_shell [command]";
int w, pid;
int shellout = 0;
- union wait status;
+ int status;
char *shell, *getenv();
/* disallow use if restricted mode set */
@@ -66,7 +66,7 @@
icbterm();
/* restore signal processing */