[comp.mail.misc] Deliver 2.0 Patch #5

chip@ateng.com (Chip Salzenberg) (12/20/89)

Changes in patch #5 to Deliver 2.0:

1.  Some preprocessors don't like #elif; removed.  Too bad.

2.  The tm structure on Xenix includes the timezone name "tm_name", but it
    seems that Xenix is unique in this respect.  Therefore, USG systems
    (including Xenix) now find the timezone name in the global array
    "char *tzname[]", which is set by the library routine tzset().
    BSD systems will continue to use "tm_zone".

3.  UUCP mail is now queued using the real context instead of the effective
    context.  This change will allow users to kill UUCP mail they've sent by
    mistake.


This patch contains changes to the following files:
	patchlevel.h
	main.c
	misc.h
	sysdep.c
	unctime.y
	uucp.c

Index: patchlevel.h
Prereq: 4
***************
*** 1,1 ****
! #define PATCHLEVEL 4
--- 1,1 ----
! #define PATCHLEVEL 5

Index: main.c
***************
*** 1,3 ****
! /* $Header: main.c,v 2.4 89/11/10 12:23:55 network Exp $
   *
   * A program to deliver local mail with some flexibility.
--- 1,3 ----
! /* $Header: main.c,v 2.6 89/12/19 16:45:26 network Exp $
   *
   * A program to deliver local mail with some flexibility.
***************
*** 4,7 ****
--- 4,13 ----
   *
   * $Log:	main.c,v $
+  * Revision 2.6  89/12/19  16:45:26  network
+  * Include <time.h> for the functions.
+  * 
+  * Revision 2.5  89/12/19  16:29:32  network
+  * Make timezone handling portable to System V.
+  * 
   * Revision 2.4  89/11/10  12:23:55  network
   * Handle recursion.  Enhance logging.
***************
*** 24,27 ****
--- 30,34 ----
  #include "patchlevel.h"
  #include <signal.h>
+ #include <time.h>
  
  /*
***************
*** 114,117 ****
--- 121,130 ----
  	progname = basename(argv[0]);
  
+ #ifdef USG
+ 	/* System V requires that we ask for the time zone.  Used later. */
+ 
+ 	tzset();
+ #endif
+ 
  	/* Special hack -- handle the recursion level and parent first. */
  

Index: misc.h
***************
*** 1,3 ****
! /* $Header: misc.h,v 2.3 89/12/14 17:43:10 network Exp $
   *
   * Miscellaneous definitions.
--- 1,3 ----
! /* $Header: misc.h,v 2.4 89/12/19 16:28:05 network Exp $
   *
   * Miscellaneous definitions.
***************
*** 4,7 ****
--- 4,10 ----
   *
   * $Log:	misc.h,v $
+  * Revision 2.4  89/12/19  16:28:05  network
+  * Simplify preprocessor conditionals for pre-ANSI compilers.
+  * 
   * Revision 2.3  89/12/14  17:43:10  network
   * Rework setvbuf() configuration to avoid errors.
***************
*** 122,131 ****
  #ifdef USG
  
! #if   defined(SETVBUF_BUF_TYPE)
  #define Linebuf(f)      (void) setvbuf(f, (char *)NULL, _IOLBF, BUFSIZ)
! #elif defined(SETVBUF_TYPE_BUF)
  #define Linebuf(f)      (void) setvbuf(f, _IOLBF, (char *)NULL, BUFSIZ)
- #else
- #define Linebuf(f)      (void) setbuf(f, (char *)NULL)
  #endif
  
--- 125,133 ----
  #ifdef USG
  
! #ifdef SETVBUF_BUF_TYPE
  #define Linebuf(f)      (void) setvbuf(f, (char *)NULL, _IOLBF, BUFSIZ)
! #endif
! #ifdef SETVBUF_TYPE_BUF
  #define Linebuf(f)      (void) setvbuf(f, _IOLBF, (char *)NULL, BUFSIZ)
  #endif
  
***************
*** 135,142 ****
  #define Linebuf(f)      (void) setlinebuf(f)
  
! #else /* not BSD */
  
! #define Linebuf(f)      /* can't do it */
  
! #endif /* not BSD */
! #endif /* not USG */
--- 137,146 ----
  #define Linebuf(f)      (void) setlinebuf(f)
  
! #endif /* BSD */
! #endif /* not USG */
  
! /* If line buffering isn't possible, don't buffer at all. */
  
! #ifndef Linebuf
! #define Linebuf(f)      (void) setbuf(f, (char *)NULL)
! #endif

Index: sysdep.c
***************
*** 1,3 ****
! /* $Header: sysdep.c,v 2.4 89/11/10 12:23:58 network Exp $
   *
   * Routines which are (or might well be) system-dependant.
--- 1,3 ----
! /* $Header: sysdep.c,v 2.5 89/12/19 16:29:47 network Exp $
   *
   * Routines which are (or might well be) system-dependant.
***************
*** 6,9 ****
--- 6,12 ----
   *
   * $Log:	sysdep.c,v $
+  * Revision 2.5  89/12/19  16:29:47  network
+  * Make timezone handling portable to System V.
+  * 
   * Revision 2.4  89/11/10  12:23:58  network
   * Log recursion depth, undelivered mail and failed headers.
***************
*** 343,348 ****
  			lt->tm_mday, month[lt->tm_mon], lt->tm_year + 1900,
  			lt->tm_hour, lt->tm_min, lt->tm_sec,
! #ifdef LTZNMAX
! 			lt->tm_name
  #else
  			lt->tm_zone
--- 346,351 ----
  			lt->tm_mday, month[lt->tm_mon], lt->tm_year + 1900,
  			lt->tm_hour, lt->tm_min, lt->tm_sec,
! #ifdef USG
! 			tzname[lt->tm_isdst ? 1 : 0]
  #else
  			lt->tm_zone

Index: unctime.y
***************
*** 1,4 ****
  /*
!  * $Header: unctime.y,v 2.3 89/12/14 17:33:56 network Exp $
   *
   * Conversion of ctime-style date string back to a time_t.
--- 1,4 ----
  /*
!  * $Header: unctime.y,v 2.4 89/12/19 16:29:49 network Exp $
   *
   * Conversion of ctime-style date string back to a time_t.
***************
*** 7,10 ****
--- 7,13 ----
   *
   * $Log:	unctime.y,v $
+  * Revision 2.4  89/12/19  16:29:49  network
+  * Make timezone handling portable to System V.
+  * 
   * Revision 2.3  89/12/14  17:33:56  network
   * Fix for Ultrix, which doesn't define DST_CAN.
***************
*** 429,433 ****
    /* Since no correction was explicitly specified, we use local time zone. */
  #ifdef USG
-   tzset();
    return (int) -timezone;
  #else
--- 432,435 ----

Index: uucp.c
***************
*** 1,3 ****
! /* $Header: uucp.c,v 2.2 89/11/01 12:31:17 network Exp $
   *
   * Handle mail destined for other hosts via UUCP.
--- 1,3 ----
! /* $Header: uucp.c,v 2.3 89/12/19 16:26:41 network Exp $
   *
   * Handle mail destined for other hosts via UUCP.
***************
*** 6,9 ****
--- 6,13 ----
   *
   * $Log:	uucp.c,v $
+  * Revision 2.3  89/12/19  16:26:41  network
+  * Execute UUCP in real, not effective, context.
+  * This allows users to cancel their UUCP jobs.
+  * 
   * Revision 2.2  89/11/01  12:31:17  network
   * Use the new exists() function.
***************
*** 78,82 ****
  		av[3] = who;
  		av[4] = NULL;
! 		if ((uux_fp = ct_popenv(eff_ct, uux, av, "w")) == NULL)
  			continue;
  
--- 82,86 ----
  		av[3] = who;
  		av[4] = NULL;
! 		if ((uux_fp = ct_popenv(real_ct, uux, av, "w")) == NULL)
  			continue;
  
-- 
You may redistribute this article only to those who may freely do likewise.
Chip Salzenberg at A T Engineering;  <chip@ateng.com> or <uunet!ateng!chip>
	  "The Usenet, in a very real sense, does not exist."