summaryrefslogtreecommitdiff
path: root/net/sup/files/patch-run.c
diff options
context:
space:
mode:
authorKris Kennaway <kris@FreeBSD.org>2002-10-26 01:16:02 +0000
committerKris Kennaway <kris@FreeBSD.org>2002-10-26 01:16:02 +0000
commit24a46374181088f0b9a6413cada18e3999dcf7a7 (patch)
tree567bf617a7a32d0a78c5df125622beadede6a0b2 /net/sup/files/patch-run.c
parentFix build on -current (cope with removal of union wait, and add (diff)
Fix build on -current (cope with removal of union wait)
Submitted by: mike
Notes
Notes: svn path=/head/; revision=68842
Diffstat (limited to 'net/sup/files/patch-run.c')
-rw-r--r--net/sup/files/patch-run.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/net/sup/files/patch-run.c b/net/sup/files/patch-run.c
new file mode 100644
index 000000000000..d57f77daf692
--- /dev/null
+++ b/net/sup/files/patch-run.c
@@ -0,0 +1,56 @@
+--- run.c.orig Fri Aug 20 20:46:33 1993
++++ run.c Fri Oct 25 10:23:26 2002
+@@ -95,6 +95,7 @@
+ #include <signal.h>
+ #include <sys/wait.h>
+ #include <varargs.h>
++#define MAXARGS 100
+
+ static int dorun();
+
+@@ -123,10 +124,14 @@
+ {
+ int val;
+ va_list ap;
+-
++ char *args[MAXARGS];
++ int argno=0;
++
+ va_start(ap);
+- val = runvp (name,ap);
++ while (argno < MAXARGS
++ && (args[argno++] = va_arg(ap, char *)) != (char *)0);
+ va_end(ap);
++ val = runvp (name,args);
+ return (val);
+ }
+
+@@ -144,7 +149,7 @@
+ int wpid;
+ register int pid;
+ struct sigvec ignoresig,intsig,quitsig;
+- union wait status;
++ int status;
+ int execvp(), execv();
+ int (*execrtn)() = usepath ? execvp : execv;
+
+@@ -165,7 +170,7 @@
+ sigvec (SIGINT,&ignoresig,&intsig);
+ sigvec (SIGQUIT,&ignoresig,&quitsig);
+ do {
+- wpid = wait3 (&status.w_status, WUNTRACED, 0);
++ wpid = wait3 (&status, WUNTRACED, 0);
+ if (WIFSTOPPED (status)) {
+ kill (0,SIGTSTP);
+ wpid = 0;
+@@ -174,8 +179,8 @@
+ sigvec (SIGINT,&intsig,0); /* restore signals */
+ sigvec (SIGQUIT,&quitsig,0);
+
+- if (WIFSIGNALED (status) || status.w_retcode == 0377)
++ if (WIFSIGNALED (status) || WEXITSTATUS(status) == 0377)
+ return (-1);
+
+- return (status.w_retcode);
++ return (WEXITSTATUS(status));
+ }