From 46e5d8227d3a74c22850f98f85802338a51c9998 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Fri, 1 Apr 1988 23:50:58 -0800 Subject: [PATCH] remove V6 #ifdefs SCCS-vsn: usr.sbin/sendmail/src/arpadate.c 5.8 SCCS-vsn: usr.sbin/sendmail/src/conf.c 5.16 SCCS-vsn: usr.sbin/sendmail/src/envelope.c 5.14 SCCS-vsn: usr.sbin/sendmail/src/main.c 5.16 SCCS-vsn: usr.sbin/sendmail/src/readcf.c 5.12 --- usr/src/usr.sbin/sendmail/src/arpadate.c | 17 +-- usr/src/usr.sbin/sendmail/src/conf.c | 168 +---------------------- usr/src/usr.sbin/sendmail/src/envelope.c | 4 +- usr/src/usr.sbin/sendmail/src/main.c | 4 +- usr/src/usr.sbin/sendmail/src/readcf.c | 12 +- 5 files changed, 7 insertions(+), 198 deletions(-) diff --git a/usr/src/usr.sbin/sendmail/src/arpadate.c b/usr/src/usr.sbin/sendmail/src/arpadate.c index 9bb3ea9698..b1732e3deb 100644 --- a/usr/src/usr.sbin/sendmail/src/arpadate.c +++ b/usr/src/usr.sbin/sendmail/src/arpadate.c @@ -15,7 +15,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)arpadate.c 5.7 (Berkeley) %G%"; +static char sccsid[] = "@(#)arpadate.c 5.8 (Berkeley) %G%"; #endif /* not lint */ # include "conf.h" @@ -24,16 +24,11 @@ static char sccsid[] = "@(#)arpadate.c 5.7 (Berkeley) %G%"; # else # include "conf.h" # include -# ifndef V6 # include # include -# endif V6 # endif USG # include "useful.h" -# ifdef V6 -# define OLDTIME -# endif V6 # ifdef USG # define OLDTIME # endif USG @@ -82,9 +77,6 @@ arpadate(ud) struct timeb t; extern struct timeb *ftime(); # endif OLDTIME -# ifdef V6 - extern char *StdTimezone, *DstTimezone; -# endif V6 # ifdef USG extern char *tzname[2]; # endif USG @@ -142,12 +134,6 @@ arpadate(ud) *q++ = *p++; /* -PST or -PDT */ -# ifdef V6 - if (localtime(&t)->tm_isdst) - p = DstTimezone; - else - p = StdTimezone; -# else # ifdef USG if (localtime(&t)->tm_isdst) p = tzname[1]; @@ -156,7 +142,6 @@ arpadate(ud) # else p = localtime(&t.time)->tm_zone; # endif USG -# endif V6 if ((strncmp(p, "GMT", 3) == 0 || strncmp(p, "gmt", 3) == 0) && p[3] != '\0') { diff --git a/usr/src/usr.sbin/sendmail/src/conf.c b/usr/src/usr.sbin/sendmail/src/conf.c index 02e47cfb2a..2b1bb95282 100644 --- a/usr/src/usr.sbin/sendmail/src/conf.c +++ b/usr/src/usr.sbin/sendmail/src/conf.c @@ -15,7 +15,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)conf.c 5.15 (Berkeley) %G%"; +static char sccsid[] = "@(#)conf.c 5.16 (Berkeley) %G%"; #endif /* not lint */ # include @@ -31,11 +31,6 @@ static char sccsid[] = "@(#)conf.c 5.15 (Berkeley) %G%"; ** Defines the configuration of this installation. ** ** Compilation Flags: -** V6 -- running on a version 6 system. This determines -** whether to define certain routines between -** the two systems. If you are running a funny -** system, e.g., V6 with long tty names, this -** should be checked carefully. ** VMUNIX -- running on a Berkeley UNIX system. ** ** Configuration Variables: @@ -158,164 +153,6 @@ setdefaults() DefUid = 1; DefGid = 1; } - -# ifdef V6 -/* -** TTYNAME -- return name of terminal. -** -** Parameters: -** fd -- file descriptor to check. -** -** Returns: -** pointer to full path of tty. -** NULL if no tty. -** -** Side Effects: -** none. -*/ - -char * -ttyname(fd) - int fd; -{ - register char tn; - static char pathn[] = "/dev/ttyx"; - - /* compute the pathname of the controlling tty */ - if ((tn = ttyn(fd)) == NULL) - { - errno = 0; - return (NULL); - } - pathn[8] = tn; - return (pathn); -} - /* -** FDOPEN -- Open a stdio file given an open file descriptor. -** -** This is included here because it is standard in v7, but we -** need it in v6. -** -** Algorithm: -** Open /dev/null to create a descriptor. -** Close that descriptor. -** Copy the existing fd into the descriptor. -** -** Parameters: -** fd -- the open file descriptor. -** type -- "r", "w", or whatever. -** -** Returns: -** The file descriptor it creates. -** -** Side Effects: -** none -** -** Called By: -** deliver -** -** Notes: -** The mode of fd must match "type". -*/ - -FILE * -fdopen(fd, type) - int fd; - char *type; -{ - register FILE *f; - - f = fopen("/dev/null", type); - (void) close(fileno(f)); - fileno(f) = fd; - return (f); -} - /* -** INDEX -- Return pointer to character in string -** -** For V7 compatibility. -** -** Parameters: -** s -- a string to scan. -** c -- a character to look for. -** -** Returns: -** If c is in s, returns the address of the first -** instance of c in s. -** NULL if c is not in s. -** -** Side Effects: -** none. -*/ - -char * -index(s, c) - register char *s; - register char c; -{ - while (*s != '\0') - { - if (*s++ == c) - return (--s); - } - return (NULL); -} - /* -** UMASK -- fake the umask system call. -** -** Since V6 always acts like the umask is zero, we will just -** assume the same thing. -*/ - -/*ARGSUSED*/ -umask(nmask) -{ - return (0); -} - - -/* -** GETRUID -- get real user id. -*/ - -getruid() -{ - return (getuid() & 0377); -} - - -/* -** GETRGID -- get real group id. -*/ - -getrgid() -{ - return (getgid() & 0377); -} - - -/* -** GETEUID -- get effective user id. -*/ - -geteuid() -{ - return ((getuid() >> 8) & 0377); -} - - -/* -** GETEGID -- get effective group id. -*/ - -getegid() -{ - return ((getgid() >> 8) & 0377); -} - -# endif V6 - -# ifndef V6 /* ** GETRUID -- get real user id (V7) @@ -342,8 +179,7 @@ getrgid() return (getgid()); } -# endif V6 - /* +/* ** USERNAME -- return the user id of the logged in user. ** ** Parameters: diff --git a/usr/src/usr.sbin/sendmail/src/envelope.c b/usr/src/usr.sbin/sendmail/src/envelope.c index ad856fc6ff..befa79c611 100644 --- a/usr/src/usr.sbin/sendmail/src/envelope.c +++ b/usr/src/usr.sbin/sendmail/src/envelope.c @@ -15,7 +15,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)envelope.c 5.13 (Berkeley) %G%"; +static char sccsid[] = "@(#)envelope.c 5.14 (Berkeley) %G%"; #endif /* not lint */ #include @@ -526,10 +526,8 @@ setsender(from) } else { -#ifndef V6 if (CurEnv->e_from.q_home == NULL) CurEnv->e_from.q_home = getenv("HOME"); -#endif V6 CurEnv->e_from.q_uid = getuid(); CurEnv->e_from.q_gid = getgid(); } diff --git a/usr/src/usr.sbin/sendmail/src/main.c b/usr/src/usr.sbin/sendmail/src/main.c index 92b9a5d245..f5bc81f5d6 100644 --- a/usr/src/usr.sbin/sendmail/src/main.c +++ b/usr/src/usr.sbin/sendmail/src/main.c @@ -21,7 +21,7 @@ char copyright[] = #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)main.c 5.15 (Berkeley) %G%"; +static char sccsid[] = "@(#)main.c 5.16 (Berkeley) %G%"; #endif /* not lint */ # define _DEFINE @@ -241,9 +241,7 @@ main(argc, argv, envp) OldUmask = umask(0); OpMode = MD_DELIVER; MotherPid = getpid(); -# ifndef V6 FullName = getenv("NAME"); -# endif V6 # ifdef LOG # endif LOG diff --git a/usr/src/usr.sbin/sendmail/src/readcf.c b/usr/src/usr.sbin/sendmail/src/readcf.c index 6056af3ce9..8726837538 100644 --- a/usr/src/usr.sbin/sendmail/src/readcf.c +++ b/usr/src/usr.sbin/sendmail/src/readcf.c @@ -15,7 +15,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)readcf.c 5.11 (Berkeley) %G%"; +static char sccsid[] = "@(#)readcf.c 5.12 (Berkeley) %G%"; #endif /* not lint */ # include "sendmail.h" @@ -843,17 +843,9 @@ setoption(opt, val, sticky) case 'T': /* queue timeout */ TimeOut = convtime(val); - break; + /*FALLTHROUGH*/ case 't': /* time zone name */ -# ifdef V6 - StdTimezone = newstr(val); - DstTimezone = index(StdTimeZone, ','); - if (DstTimezone == NULL) - syserr("bad time zone spec"); - else - *DstTimezone++ = '\0'; -# endif V6 break; case 'u': /* set default uid */ -- 2.20.1