AIX compatibility changes; clean up map initialization functions
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Sat, 22 May 1993 23:58:05 +0000 (15:58 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Sat, 22 May 1993 23:58:05 +0000 (15:58 -0800)
SCCS-vsn: usr.sbin/sendmail/src/main.c 6.65
SCCS-vsn: usr.sbin/sendmail/src/conf.h 6.31
SCCS-vsn: usr.sbin/sendmail/src/parseaddr.c 6.56
SCCS-vsn: usr.sbin/sendmail/src/queue.c 6.57
SCCS-vsn: usr.sbin/sendmail/src/conf.c 6.60

usr/src/usr.sbin/sendmail/src/conf.c
usr/src/usr.sbin/sendmail/src/conf.h
usr/src/usr.sbin/sendmail/src/main.c
usr/src/usr.sbin/sendmail/src/parseaddr.c
usr/src/usr.sbin/sendmail/src/queue.c

index e71045e..4bf5e5b 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)conf.c     6.59 (Berkeley) %G%";
+static char sccsid[] = "@(#)conf.c     6.60 (Berkeley) %G%";
 #endif /* not lint */
 
 # include <sys/ioctl.h>
 #endif /* not lint */
 
 # include <sys/ioctl.h>
@@ -204,9 +204,8 @@ setdefuser()
 */
 
 bool
 */
 
 bool
-host_map_init(map, mapname, args)
+host_map_init(map, args)
        MAP *map;
        MAP *map;
-       char *mapname;
        char *args;
 {
        register char *p = args;
        char *args;
 {
        register char *p = args;
@@ -575,6 +574,7 @@ rlsesigs()
 #    define LA_AVENRUN         "avenrun"
 #  endif
 
 #    define LA_AVENRUN         "avenrun"
 #  endif
 
+/* now do the guesses based on general OS type */
 #  ifndef LA_TYPE
 #   if defined(SYSTEM5)
 #    define LA_TYPE            LA_INT
 #  ifndef LA_TYPE
 #   if defined(SYSTEM5)
 #    define LA_TYPE            LA_INT
@@ -899,6 +899,12 @@ setproctitle(fmt, va_alist)
 void
 reapchild()
 {
 void
 reapchild()
 {
+# ifdef WIFEXITED
+       auto int status;
+
+       while (waitpid(-1, &status, WNOHANG) > 0)
+               continue;
+# else
 # ifdef WNOHANG
        union wait status;
 
 # ifdef WNOHANG
        union wait status;
 
@@ -907,9 +913,10 @@ reapchild()
 # else /* WNOHANG */
        auto int status;
 
 # else /* WNOHANG */
        auto int status;
 
-       while (wait((int *)&status) > 0)
+       while (wait(&status) > 0)
                continue;
 # endif /* WNOHANG */
                continue;
 # endif /* WNOHANG */
+# endif
 # ifdef SYSTEM5
        (void) signal(SIGCHLD, reapchild);
 # endif
 # ifdef SYSTEM5
        (void) signal(SIGCHLD, reapchild);
 # endif
index 31faa7b..bdf7596 100644 (file)
@@ -5,7 +5,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)conf.h      6.30 (Berkeley) %G%
+ *     @(#)conf.h      6.31 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
 # define QUEUESIZE     1000            /* max # of jobs per queue run */
 # endif
 
 # define QUEUESIZE     1000            /* max # of jobs per queue run */
 # endif
 
-# ifndef FORK
-# define FORK          vfork           /* function to call to fork mailer */
-# endif
-
 /*
 **  Compilation options.
 **
 /*
 **  Compilation options.
 **
 # define SYSTEM5       1
 # endif
 
 # define SYSTEM5       1
 # endif
 
+# ifdef IBM_AIX
+# define LOCKF         1       /* use System V lockf instead of flock */
+# define FORK          fork    /* no vfork primitive available */
+# endif
+
 # ifdef SYSTEM5
 
 # define LOCKF         1       /* use System V lockf instead of flock */
 # ifdef SYSTEM5
 
 # define LOCKF         1       /* use System V lockf instead of flock */
@@ -232,3 +233,8 @@ struct utsname
 #ifndef TOBUFSIZE
 # define TOBUFSIZE (1024 - 256)
 #endif
 #ifndef TOBUFSIZE
 # define TOBUFSIZE (1024 - 256)
 #endif
+
+/* fork routine -- set above using #ifdef _osname_ or in Makefile */
+# ifndef FORK
+# define FORK          vfork           /* function to call to fork mailer */
+# endif
index a3b8d35..f4fa6d2 100644 (file)
@@ -13,7 +13,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     6.64 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     6.65 (Berkeley) %G%";
 #endif /* not lint */
 
 #define        _DEFINE
 #endif /* not lint */
 
 #define        _DEFINE
@@ -315,7 +315,6 @@ main(argc, argv, envp)
        if (jbuf[0] != '\0')
        {
                struct  utsname utsname;
        if (jbuf[0] != '\0')
        {
                struct  utsname utsname;
-               extern char *strchr();
 
                if (tTd(0, 4))
                        printf("canonical name: %s\n", jbuf);
 
                if (tTd(0, 4))
                        printf("canonical name: %s\n", jbuf);
index 9f5afd2..3bbe6cc 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)parseaddr.c        6.55 (Berkeley) %G%";
+static char sccsid[] = "@(#)parseaddr.c        6.56 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #include "sendmail.h"
@@ -2115,7 +2115,6 @@ maplocaluser(a, sendq, e)
 **
 **     Parameters:
 **             map -- the internal map structure.
 **
 **     Parameters:
 **             map -- the internal map structure.
-**             mapname -- the name of the mapl.
 **             args -- arguments.
 **
 **     Returns:
 **             args -- arguments.
 **
 **     Returns:
@@ -2123,9 +2122,8 @@ maplocaluser(a, sendq, e)
 */
 
 bool
 */
 
 bool
-dequote_init(map, mapname, args)
+dequote_init(map, args)
        MAP *map;
        MAP *map;
-       char *mapname;
        char *args;
 {
        register char *p = args;
        char *args;
 {
        register char *p = args;
index f3ea45a..479bcb3 100644 (file)
 
 #ifndef lint
 #ifdef QUEUE
 
 #ifndef lint
 #ifdef QUEUE
-static char sccsid[] = "@(#)queue.c    6.56 (Berkeley) %G% (with queueing)";
+static char sccsid[] = "@(#)queue.c    6.57 (Berkeley) %G% (with queueing)";
 #else
 #else
-static char sccsid[] = "@(#)queue.c    6.56 (Berkeley) %G% (without queueing)";
+static char sccsid[] = "@(#)queue.c    6.57 (Berkeley) %G% (without queueing)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
-# include <sys/dir.h>
 # include <signal.h>
 # include <errno.h>
 # include <pwd.h>
 # include <signal.h>
 # include <errno.h>
 # include <pwd.h>
-# ifndef MAXNAMLEN
 # include <dirent.h>
 # include <dirent.h>
-# endif
 
 # ifdef QUEUE
 
 
 # ifdef QUEUE
 
@@ -540,7 +537,7 @@ static struct dir   dbuf;
 orderq(doall)
        bool doall;
 {
 orderq(doall)
        bool doall;
 {
-       register struct direct *d;
+       register struct dirent *d;
        register WORK *w;
        DIR *f;
        register int i;
        register WORK *w;
        DIR *f;
        register int i;