Subject: v23i003: Deliver 2.0 patches, Part03/10 Newsgroups: comp.sources.unix Approved: rsalz@uunet.UU.NET X-Checksum-Snefru: 58e1f270 bd173224 8af05a66 a653f0ef Submitted-by: Chip Salzenberg Posting-number: Volume 23, Issue 3 Archive-name: deliver2.0pch/part03 Changes in patch #4 to Deliver 2.0: 1. Configuration of setvbuf() is now based on these definitions: SETVBUF_BUF_TYPE setvbuf(.., buf, type, ..) SETVBUF_TYPE_BUF setvbuf(.., type, buf, ..) If neither of these is defined, then setvbuf() is not called at all. This change is prompted by the occasional configuration mistakes that result in core dumps. 2. The setlinebuf() and setvbuf() functions are no longer (re)defined in misc.h. We now depend on . Since they return int, no danger. 3. Timezone interpretation code has been modified for Ultrix, which doesn't define the DST_CAN macro. This patch contains changes to the following files: patchlevel.h config.h misc.h unctime.y Index: patchlevel.h Prereq: 3 *************** *** 1,1 **** ! #define PATCHLEVEL 3 --- 1,1 ---- ! #define PATCHLEVEL 4 Index: config.h *************** *** 1,3 **** ! /* $Header: config.h,v 2.5 89/11/10 12:23:49 network Exp $ * * Deliver configuration. --- 1,3 ---- ! /* $Header: config.h,v 2.6 89/12/14 17:42:25 network Exp $ * * Deliver configuration. *************** *** 4,7 **** --- 4,10 ---- * * $Log: config.h,v $ + * Revision 2.6 89/12/14 17:42:25 network + * Rework setvbuf() configuration to avoid errors. + * * Revision 2.5 89/11/10 12:23:49 network * Handle recursion. *************** *** 58,61 **** --- 61,81 ---- /*---------------------------------------------------------------------- + * Argument order for setvbuf(): + * SETVBUF_BUF_TYPE (.., buf, type, ..) (Correct) + * SETVBUF_TYPE_BUF (.., type, buf, ..) (Broken) + * + * Broken systems that need SETVBUF_TYPE_BUF include: + * SCO Xenix development system 2.2 + * SysVR3.0 (Probably) + * SysVR3.1 (Maybe) + * + * If neither is defined, then setvbuf() will not be called. + * >>> Be sure to get this one right, or the program will dump core. <<< + */ + + #define SETVBUF_BUF_TYPE + /* #define SETVBUF_TYPE_BUF */ + + /*---------------------------------------------------------------------- * Signal function declaration. * Define this if your doesn't declare signal() correctly. *************** *** 175,185 **** /*---------------------------------------------------------------------- - * Is setvbuf() backwards? - * Note: this is true for SCO Xenix Development System 2.2. - */ - - /* #define REVERSE_SETVBUF */ - - /*---------------------------------------------------------------------- * Name of shell used to execute delivery files. */ --- 195,198 ---- Index: misc.h *************** *** 1,3 **** ! /* $Header: misc.h,v 2.2 89/10/02 10:36:43 network Exp $ * * Miscellaneous definitions. --- 1,3 ---- ! /* $Header: misc.h,v 2.3 89/12/14 17:43:10 network Exp $ * * Miscellaneous definitions. *************** *** 4,7 **** --- 4,10 ---- * * $Log: misc.h,v $ + * Revision 2.3 89/12/14 17:43:10 network + * Rework setvbuf() configuration to avoid errors. + * * Revision 2.2 89/10/02 10:36:43 network * Declare exit() as void. *************** *** 119,128 **** #ifdef USG ! extern int setvbuf(); ! ! #ifdef REVERSE_SETVBUF #define Linebuf(f) (void) setvbuf(f, _IOLBF, (char *)NULL, BUFSIZ) #else ! #define Linebuf(f) (void) setvbuf(f, (char *)NULL, _IOLBF, BUFSIZ) #endif --- 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 *************** *** 130,135 **** #ifdef BSD - extern int setlinebuf(); - #define Linebuf(f) (void) setlinebuf(f) --- 133,136 ---- Index: unctime.y *************** *** 1,4 **** /* ! * $Header: unctime.y,v 2.2 89/10/31 12:15:45 network Exp $ * * Conversion of ctime-style date string back to a time_t. --- 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. *************** *** 7,10 **** --- 7,13 ---- * * $Log: unctime.y,v $ + * Revision 2.3 89/12/14 17:33:56 network + * Fix for Ultrix, which doesn't define DST_CAN. + * * Revision 2.2 89/10/31 12:15:45 network * Fix erroneous cast in BSD-specific code. *************** *** 348,351 **** --- 351,355 ---- /* Canada is same as US, except no early 70's insanity. */ + #ifdef DST_CAN static struct dstinfo can_dst[] = *************** *** 353,356 **** --- 357,361 ---- 0, 119, 303 }; + #endif struct dst_rules *************** *** 369,373 **** --- 374,380 ---- DST_MET, meur_dst, 60, DST_EET, meur_dst, 60, + #ifdef DST_CAN DST_CAN, can_dst, 60, + #endif -1, 0, 0 }; exit 0 # Just in case...