include hacks to allow old versions of wait that use "union wait"
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Thu, 23 Sep 1993 01:32:25 +0000 (17:32 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Thu, 23 Sep 1993 01:32:25 +0000 (17:32 -0800)
SCCS-vsn: usr.sbin/sendmail/src/READ_ME 8.25
SCCS-vsn: usr.sbin/sendmail/src/conf.h 8.35
SCCS-vsn: usr.sbin/sendmail/src/util.c 8.11

usr/src/usr.sbin/sendmail/src/READ_ME
usr/src/usr.sbin/sendmail/src/conf.h
usr/src/usr.sbin/sendmail/src/util.c

index ae4e72c..e509030 100644 (file)
@@ -4,7 +4,7 @@
 #
 # %sccs.include.redist.sh%
 #
 #
 # %sccs.include.redist.sh%
 #
-#      @(#)READ_ME     8.24 (Berkeley) %G%
+#      @(#)READ_ME     8.25 (Berkeley) %G%
 #
 
 This directory contains the source files for sendmail.
 #
 
 This directory contains the source files for sendmail.
@@ -169,6 +169,9 @@ ERRLIST_PREDEFINED
                If set, assumes that some header file defines sys_errlist.
                This may be needed if you get type conflicts on this
                variable -- otherwise don't worry about it.
                If set, assumes that some header file defines sys_errlist.
                This may be needed if you get type conflicts on this
                variable -- otherwise don't worry about it.
+WAITUNION      The wait(2) routine takes a "union wait" argument instead
+               of an integer argument.  This is for compatibility with
+               old versions of BSD.
 
 
 +-----------------------+
 
 
 +-----------------------+
@@ -400,4 +403,4 @@ version.c   The version number and information about this
 
 Eric Allman
 
 
 Eric Allman
 
-(Version 8.24, last update %G% 09:13:44)
+(Version 8.25, last update %G% 10:32:22)
index 96fdd4b..e7c78dc 100644 (file)
@@ -5,7 +5,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)conf.h      8.34 (Berkeley) %G%
+ *     @(#)conf.h      8.35 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
 # define HASINITGROUPS 1       /* has initgroups(3) call */
 # define HASSTATFS     1       /* has the statfs(2) syscall */
 # define FORK          fork    /* no vfork primitive available */
 # define HASINITGROUPS 1       /* has initgroups(3) call */
 # define HASSTATFS     1       /* has the statfs(2) syscall */
 # define FORK          fork    /* no vfork primitive available */
+# define WAITUNION     1       /* use "union wait" as wait argument type */
 # define setpgid       BSDsetpgrp
 # define GIDSET_T      gid_t
 # endif
 # define setpgid       BSDsetpgrp
 # define GIDSET_T      gid_t
 # endif
index add07ee..613002e 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)util.c     8.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)util.c     8.11 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -999,10 +999,15 @@ atooct(s)
 **             none.
 */
 
 **             none.
 */
 
+int
 waitfor(pid)
        int pid;
 {
 waitfor(pid)
        int pid;
 {
+#ifdef WAITUNION
+       union wait st;
+#else
        auto int st;
        auto int st;
+#endif
        int i;
 
        do
        int i;
 
        do
@@ -1011,8 +1016,12 @@ waitfor(pid)
                i = wait(&st);
        } while ((i >= 0 || errno == EINTR) && i != pid);
        if (i < 0)
                i = wait(&st);
        } while ((i >= 0 || errno == EINTR) && i != pid);
        if (i < 0)
-               st = -1;
-       return (st);
+               return -1;
+#ifdef WAITUNION
+       return st.w_status;
+#else
+       return st;
+#endif
 }
 \f/*
 **  BITINTERSECT -- tell if two bitmaps intersect
 }
 \f/*
 **  BITINTERSECT -- tell if two bitmaps intersect