Some of the changes are to POSIX in general, and mirror some things I've
been doing in BIND lately. Other changes are due to OSF/1 dain bramage.
First, my MH conf file (between the ---------'s), then the RCS -c2 diffs.
I've been running these in production for about a week with no problems.
---------
# @(#)$Id: MH,v 1.7 1990/04/06 09:44:31 sources Exp $
# an Alpha/OSF1 system running SendMail
cc cc
#ccoptions -O -Olimit 700
ccoptions -g
bin /usr/local/bin
etc /usr/local/lib/mh
mandir /usr/local/man
mail /var/spool/mail
chown /usr/ucb/chown
manuals standard
mts sendmail/smtp
sprintf int
signal void
options BIND BSD42 BSD43 DBMPWD MORE='"/usr/ucb/more"'
options SYS5DIR NTOHLSWAP OVERHEAD VSPRINTF WHATNOW ZONEINFO TERMINFO
options MHE MHRC MIME
options POSIX
options BSD44 WAITINT UNISTD
options FLOCK
#
# POP
#
pop on
popdir /usr/local/libexec
#options APOP='"/etc/pop.auth"'
#options DPOP
#options MPOP
options POP2
options RPOP
options POPSERVICE='"pop"'
---------
*** 1.27 1993/12/01 03:50:31
--- mts/sendmail/smail.c 1995/09/08 23:05:17
***************
*** 1054,1059 ****
static int smtalk (time, fmt, a, b, c, d)
! register int time;
! register char *fmt;
{
register int result;
--- 1054,1063 ----
static int smtalk (time, fmt, a, b, c, d)
! int time;
! char *fmt,
! *a,
! *b,
! *c,
! *d;
{
register int result;
*** 1.4 1993/08/25 17:18:31
--- sbr/advertise.c 1995/09/08 16:15:04
***************
*** 16,19 ****
--- 16,22 ----
*/
+ #ifdef POSIX
+ #include <errno.h>
+ #else
extern int errno;
#ifndef BSD44 /* in <stdio.h> */
***************
*** 21,24 ****
--- 24,28 ----
extern char *sys_errlist[];
#endif
+ #endif /*POSIX*/
/* */
***************
*** 85,89 ****
}
if (eindex > 0 && eindex < sys_nerr)
! iov -> iov_len = strlen (iov -> iov_base = sys_errlist[eindex]);
else {
(void) sprintf (err, "Error %d", eindex);
--- 89,99 ----
}
if (eindex > 0 && eindex < sys_nerr)
! iov -> iov_len = strlen (iov -> iov_base =
! #ifdef POSIX
! strerror(eindex)
! #else
! sys_errlist[eindex]
! #endif
! );
else {
(void) sprintf (err, "Error %d", eindex);
*** 1.4 1993/02/26 21:57:34
--- sbr/pidstatus.c 1995/09/08 16:24:57
***************
*** 9,14 ****
! #ifndef BSD44
! #ifndef BSD42
static char *sigs[] = {
NULL,
--- 9,20 ----
! #if defined(BSD42) && !defined(__alpha) && !defined(__osf__)
! # define USE_SYS_SIGLIST
! # if !defined(BSD44)
! extern char *sys_siglist[];
! # endif
! #endif
!
! #if !defined(USE_SYS_SIGLIST)
static char *sigs[] = {
NULL,
***************
*** 44,51 ****
NULL
};
! #else
! extern char *sys_siglist[];
! #endif /* BSD42 */
! #endif /* BSD44 defines sys_siglist in signal.h */
/* */
--- 50,54 ----
NULL
};
! #endif
/* */
***************
*** 76,85 ****
if (cp)
fprintf (fp, "%s: ", cp);
! #ifndef BSD42
! if (signum >= sizeof sigs || sigs[signum] == NULL)
! fprintf (fp, "Signal %d", signum);
! else
! fprintf (fp, "%s", sigs[signum]);
! #else /* BSD42 */
if (signum >= NSIG)
fprintf (fp, "Signal %d", signum);
--- 79,83 ----
if (cp)
fprintf (fp, "%s: ", cp);
! #ifdef USE_SYS_SIGLIST
if (signum >= NSIG)
fprintf (fp, "Signal %d", signum);
***************
*** 86,90 ****
else
fprintf (fp, "%s", sys_siglist[signum]);
! #endif /* BSD42 */
fprintf (fp, "%s\n", status & 0x80 ? " (core dumped)" : "");
break;
--- 84,93 ----
else
fprintf (fp, "%s", sys_siglist[signum]);
! #else
! if (signum >= sizeof sigs || sigs[signum] == NULL)
! fprintf (fp, "Signal %d", signum);
! else
! fprintf (fp, "%s", sigs[signum]);
! #endif
fprintf (fp, "%s\n", status & 0x80 ? " (core dumped)" : "");
break;
*** 1.13 1993/08/25 17:25:27
--- uip/ftpsbr.c 1995/09/08 06:19:50
***************
*** 67,70 ****
--- 67,73 ----
/* */
+ #ifdef POSIX
+ #include <errno.h>
+ #else
extern int errno;
#ifndef BSD44
***************
*** 72,76 ****
extern char *sys_errlist[];
#endif
!
#define start_tcp_client(sock,priv) \
--- 75,79 ----
extern char *sys_errlist[];
#endif
! #endif /*POSIX*/
#define start_tcp_client(sock,priv) \
***************
*** 162,165 ****
--- 165,171 ----
bp += strlen (bp);
}
+ #ifdef POSIX
+ strcpy(bp, strerror(eindex));
+ #else
if (0 < eindex && eindex < sys_nerr)
(void) strcpy (bp, sys_errlist[eindex]);
***************
*** 166,169 ****
--- 172,176 ----
else
(void) sprintf (bp, "Error %d", eindex);
+ #endif
bp += strlen (bp);
}
*** 2.35 1993/10/26 22:17:44
--- uip/mhn.c 1995/09/08 06:23:02
***************
*** 1017,1021 ****
struct str2init {
char *si_key;
! int si_value;
int (*si_init) ();
};
--- 1017,1021 ----
struct str2init {
char *si_key;
! int si_val;
int (*si_init) ();
};
***************
*** 1155,1159 ****
if (!s2i -> si_key && !uprf (ci -> ci_type, "X-"))
s2i++;
! ct -> c_type = s2i -> si_value;
ct -> c_ctinitfnx = s2i -> si_init;
goto got_header;
--- 1155,1159 ----
if (!s2i -> si_key && !uprf (ci -> ci_type, "X-"))
s2i++;
! ct -> c_type = s2i -> si_val;
ct -> c_ctinitfnx = s2i -> si_init;
goto got_header;
***************
*** 1194,1198 ****
s2i++;
*dp = c;
! ct -> c_encoding = s2i -> si_value;
if (s2i -> si_init && (*s2i -> si_init) (ct) == NOTOK)
goto out;
--- 1194,1198 ----
s2i++;
*dp = c;
! ct -> c_encoding = s2i -> si_val;
if (s2i -> si_init && (*s2i -> si_init) (ct) == NOTOK)
goto out;
***************
*** 3646,3650 ****
}
e -> eb_access = s2i -> si_key;
! e -> eb_flags = s2i -> si_value;
p -> c_encoding = CE_EXTERNAL;
if (init_encoding (p, s2i -> si_init) == NOTOK)
--- 3646,3650 ----
}
e -> eb_access = s2i -> si_key;
! e -> eb_flags = s2i -> si_val;
p -> c_encoding = CE_EXTERNAL;
if (init_encoding (p, s2i -> si_init) == NOTOK)
***************
*** 5858,5862 ****
if (!s2i -> si_key && !uprf (ci -> ci_type, "X-"))
s2i++;
! switch (ct -> c_type = s2i -> si_value) {
case CT_MESSAGE:
if (uleq (ci -> ci_subtype, "rfc822")) {
--- 5858,5862 ----
if (!s2i -> si_key && !uprf (ci -> ci_type, "X-"))
s2i++;
! switch (ct -> c_type = s2i -> si_val) {
case CT_MESSAGE:
if (uleq (ci -> ci_subtype, "rfc822")) {
***************
*** 5894,5898 ****
adios (NULLCP, "missing subtype in \"#%s\"", ci -> ci_type);
! switch (ct -> c_type = s2i -> si_value) {
case CT_MULTIPART:
adios (NULLCP, "use \"#begin ... #end\" instead of \"#%s/%s\"",
--- 5894,5898 ----
adios (NULLCP, "missing subtype in \"#%s\"", ci -> ci_type);
! switch (ct -> c_type = s2i -> si_val) {
case CT_MULTIPART:
adios (NULLCP, "use \"#begin ... #end\" instead of \"#%s/%s\"",
*** 2.6 1993/08/26 18:25:52
--- uip/popsbr.c 1995/09/08 06:18:16
***************
*** 28,31 ****
--- 28,34 ----
#define TRMLEN (sizeof TRM - 1)
+ #ifdef POSIX
+ #include <errno.h>
+ #else
extern int errno;
#ifndef BSD44
***************
*** 33,36 ****
--- 36,40 ----
extern char *sys_errlist[];
#endif
+ #endif /*POSIX*/
static int poprint = 0;
***************
*** 158,163 ****
if ((fd2 = dup (fd1)) == NOTOK) {
(void) sprintf (response, "unable to dup connection descriptor: %s",
! errno > 0 && errno < sys_nerr ? sys_errlist[errno]
! : "unknown error");
(void) close (fd1);
return NOTOK;
--- 162,173 ----
if ((fd2 = dup (fd1)) == NOTOK) {
(void) sprintf (response, "unable to dup connection descriptor: %s",
! #ifdef POSIX
! strerror(errno)
! #else
! errno > 0 && errno < sys_nerr
! ? sys_errlist[errno]
! : "unknown error"
! #endif
! );
(void) close (fd1);
return NOTOK;
*** 1.20 1993/08/25 17:29:44
--- uip/vmh.c 1995/09/08 16:17:33
***************
*** 60,64 ****
#define TCGETATTR /* tcgetattr() */
#endif
! #ifdef BSD44
#define USE_OLD_TTY
#define _maxx maxx /* curses.h */
--- 60,64 ----
#define TCGETATTR /* tcgetattr() */
#endif
! #if defined(BSD44) && !defined(__alpha) && !defined(__osf__)
#define USE_OLD_TTY
#define _maxx maxx /* curses.h */
***************
*** 1136,1140 ****
lp -> l_no = (ltail ? ltail -> l_no : 0) + 1;
! #ifndef BSD44
lp -> l_buf = getcpy (w -> _y[w -> _cury]);
#else
--- 1136,1140 ----
lp -> l_no = (ltail ? ltail -> l_no : 0) + 1;
! #if !defined(BSD44) || (defined(__alpha) && defined(__osf__))
lp -> l_buf = getcpy (w -> _y[w -> _cury]);
#else
*** 1.11 1993/08/25 17:29:53
--- uip/vmhsbr.c 1995/09/08 06:24:06
***************
*** 25,29 ****
static int PEERwfd = NOTOK;
!
extern int errno;
#ifndef BSD44
--- 25,31 ----
static int PEERwfd = NOTOK;
! #ifdef POSIX
! #include <errno.h>
! #else
extern int errno;
#ifndef BSD44
***************
*** 31,34 ****
--- 33,37 ----
extern char *sys_errlist[];
#endif
+ #endif /*POSIX*/
static int rclose();
***************
*** 207,210 ****
--- 210,216 ----
bp += strlen (bp);
}
+ #ifdef POSIX
+ strcpy(bp, strerror(eindex));
+ #else
if (eindex > 0 && eindex < sys_nerr)
(void) strcpy (bp, sys_errlist[eindex]);
***************
*** 211,214 ****
--- 217,221 ----
else
(void) sprintf (bp, "Error %d", eindex);
+ #endif
bp += strlen (bp);
}
*** 1.21 1993/08/25 17:32:58
--- zotnet/mts/client.c 1995/09/08 19:24:47
***************
*** 96,103 ****
#endif
! #define inaddr_copy(hp,sin) \
bcopy ((hp) -> h_addr, (char *) &((sin) -> sin_addr), (hp) -> h_length)
-
struct hostent *gethostbystring ();
--- 96,102 ----
#endif
! #define inaddr_copy(hp,sin) \
bcopy ((hp) -> h_addr, (char *) &((sin) -> sin_addr), (hp) -> h_length)
struct hostent *gethostbystring ();
***************
*** 108,111 ****
--- 107,116 ----
/* */
+ #if 0
+ #define dprintf(lev,args) if (lev > 0) printf args
+ #else
+ #define dprintf(lev,args)
+ #endif
+
int client (args, protocol, service, rproto, response)
char *args,
***************
*** 126,129 ****
--- 131,137 ----
char *cp;
+ dprintf(1, ("client('%s', '%s', '%s', '%s', %d)\n",
+ args, protocol, service, rproto, response));
+
if (cp = index (kservice = service, '/')) { /* "pop/kpop" */
*cp++ = '\0'; /* kservice = "pop" */
***************
*** 163,166 ****
--- 171,175 ----
for (ap = arguments; *ap; ap++) {
+ dprintf(2, ("client loop: '%s' (%d)\n", *ap, **ap));
if (**ap == '\01') {
#ifndef BIND
***************
*** 224,238 ****
#endif /* KPOP */
for (ap = nets; ap < ne; ap++)
! if (ap -> a_addrtype == hp -> h_addrtype && inet (hp, ap -> a_net))
return NOTOK;
for (ap = hosts; ap < he; ap++)
if (ap -> a_addrtype == hp -> h_addrtype
! && bcmp (ap -> a_addr, hp -> h_addr, hp -> h_length) == 0)
return NOTOK;
! if ((sd = getport (rproto, hp -> h_addrtype, response)) == NOTOK)
return OOPS2;
bzero ((char *) isock, sizeof *isock);
--- 233,254 ----
#endif /* KPOP */
+ dprintf(2, ("rcaux(%#x, %#x, %d, %#x)\n", sp, hp, rproto, response));
for (ap = nets; ap < ne; ap++)
! if (ap -> a_addrtype == hp -> h_addrtype && inet (hp, ap -> a_net)) {
! dprintf(2, ("rcaux NOTOK 1\n"));
return NOTOK;
+ }
for (ap = hosts; ap < he; ap++)
if (ap -> a_addrtype == hp -> h_addrtype
! && bcmp (ap -> a_addr, hp -> h_addr, hp -> h_length) == 0) {
! dprintf(2, ("rcaux NOTOK 2\n"));
return NOTOK;
+ }
! if ((sd = getport (rproto, hp -> h_addrtype, response)) == NOTOK) {
! dprintf(2, ("rcaux OOPS2\n"));
return OOPS2;
+ }
bzero ((char *) isock, sizeof *isock);
***************
*** 241,244 ****
--- 257,264 ----
isock -> sin_port = sp -> s_port;
+ dprintf(2, ("rcaux connecting to [%s].%d\n",
+ inet_ntoa(isock->sin_addr),
+ ntohs(isock->sin_port)));
+
if (connect (sd, (struct sockaddr *) isock, sizeof *isock) == NOTOK)
switch (errno) {
***************
*** 252,255 ****
--- 272,276 ----
ne++;
}
+ dprintf(2, ("rcaux OOPS1\n"));
return OOPS1;
***************
*** 263,266 ****
--- 284,288 ----
he++;
}
+ dprintf(2, ("rcaux NOTOK 3\n"));
return NOTOK;
}
***************
*** 360,364 ****
/* taken from ISODE's compat/internet.c */
! #ifndef DG
u_long inet_addr ();
#else
--- 382,387 ----
/* taken from ISODE's compat/internet.c */
! #if !defined(BSD44) && !defined(BSD43)
! #ifndef DG
u_long inet_addr ();
#else
***************
*** 365,369 ****
struct in_addr inet_addr ();
#endif
!
static char *empty = NULL;
--- 388,392 ----
struct in_addr inet_addr ();
#endif
! #endif
static char *empty = NULL;
***************
*** 383,387 ****
--- 406,414 ----
static struct hostent hs;
+ #ifdef BSD44
+ if (!inet_aton(s, &iaddr))
+ #else
iaddr = inet_addr (s);
+ dprintf(3, ("gethostbystring(%s): [%s]\n", s, inet_ntoa(iaddr)));
#ifndef DG
if (iaddr == NOTOK && strcmp (s, "255.255.255.255"))
***************
*** 389,393 ****
if (iaddr.s_addr == NOTOK && strcmp (s, "255.255.255.255"))
#endif
! return gethostbyname (s);
h = &hs;
--- 416,425 ----
if (iaddr.s_addr == NOTOK && strcmp (s, "255.255.255.255"))
#endif
! #endif /*BSD44*/
! {
! h = gethostbyname (s);
! dprintf(3, ("gethostbyname(%s) -> %#x\n", s, h));
! return h;
! }
h = &hs;
*** 2.19 1993/08/25 17:33:09
--- zotnet/mts/lock.c 1995/09/08 06:06:21
***************
*** 58,66 ****
#define rindex strrchr
#endif
! #ifdef BSD42
#define FLOCK /* LOCKF will override this, if defined */
#endif
extern int errno;
#ifdef LOCKONLY
--- 58,68 ----
#define rindex strrchr
#endif
! #if defined(BSD42) && !defined(FLOCK)
#define FLOCK /* LOCKF will override this, if defined */
#endif
+ #if defined(POSIX) && !defined(ENOENT)
extern int errno;
+ #endif
#ifdef LOCKONLY
***************
*** 73,77 ****
static lockname(), timerON(), timerOFF();
! long time ();
/* */
--- 75,83 ----
static lockname(), timerON(), timerOFF();
! #ifdef POSIX
! #include <time.h>
! #else
! extern long time ();
! #endif
/* */
*** 1.15 1992/12/15 00:20:22
--- zotnet/tws/dtime.c 1995/09/08 06:14:44
***************
*** 108,113 ****
--- 108,115 ----
#define CENTURY 1900
+ #ifndef POSIX
long time ();
struct tm *localtime ();
+ #endif
/* */
***************
*** 114,118 ****
char *dtimenow () {
! long clock;
(void) time (&clock);
--- 116,120 ----
char *dtimenow () {
! time_t clock;
(void) time (&clock);
***************
*** 140,144 ****
struct tws *dtwstime () {
! long clock;
(void) time (&clock);
--- 142,146 ----
struct tws *dtwstime () {
! time_t clock;
(void) time (&clock);
***************
*** 148,152 ****
struct tws *dlocaltime (clock)
! register long *clock;
{
register struct tm *tm;
--- 150,154 ----
struct tws *dlocaltime (clock)
! register time_t *clock;
{
register struct tm *tm;
***************
*** 193,197 ****
struct tws *dgmtime (clock)
! register long *clock;
{
register struct tm *tm;
--- 195,199 ----
struct tws *dgmtime (clock)
! register time_t *clock;
{
register struct tm *tm;