Return to BSD News archive
Newsgroups: comp.bugs.2bsd Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!hobyah.cc.uq.oz.au!bunyip.cc.uq.oz.au!munnari.OZ.AU!news.ecn.uoknor.edu!qns3.qns.com!imci4!newsfeed.internetmci.com!news.kei.com!nntp.coast.net!frankensun.altair.com!wlbr!moe!sms From: sms@moe.2bsd.com (Steven M. Schultz) Subject: sys_errlist[] wastes 2kb of D-space [+fix] (#311 3 of 4) Organization: GTE Government Systems, Westlake Village Message-ID: <Dp4GIF.G8p@moe.2bsd.com> Date: Sun, 31 Mar 1996 07:51:51 GMT Lines: 2023 Subject: sys_errlist[] wastes 2kb of D-space [+fix] (#311 3 of 4) Index: lib/libc/gen/errlst.c+many,many_more 2.11BSD Description: The array of system error message strings occupies approximately 2kb of Data space in any program which calls perror(), strerror() or explicitly references sys_errlist[] or sys_nerr. Since sys_errlist is initialized data it also occupies ~4 sectors of disk space in each program's executable disk image. Repeat-By: Observation. Or by compiling these test programs and using size(1): extern char *sys_errlist[]; main() { char *cp; cp = sys_errlist[0]; exit(0); } cc x.c size a.out text data bss dec hex 362 2042 4 2408 968 main() { perror("foo"); exit(0); } cc y.c size a.out text data bss dec hex 3310 2298 4 5668 1624 In both cases the 'data' segment is 100% sys_errlist[]'s contribution. After applying the updates in this kit the second program's size is: text data bss dec hex 1008 60 68 1136 470 Fix: This is #311 (part 3 of 4). This is the second of the three patch files in the update kit. Refer to the instructions in #309. -------------------------cut here----------------------------- *** /usr/src/ucb/ex/ex_subr.c.old Sun Sep 8 12:00:56 1991 --- /usr/src/ucb/ex/ex_subr.c Fri Mar 22 17:30:38 1996 *************** *** 5,11 **** */ #if !defined(lint) && defined(DOSCCS) ! static char *sccsid = "@(#)ex_subr.c 7.10 (Berkeley) 6/7/85"; #endif #include "ex.h" --- 5,11 ---- */ #if !defined(lint) && defined(DOSCCS) ! static char *sccsid = "@(#)ex_subr.c 7.10.1 (2.11BSD) 1996/3/22"; #endif #include "ex.h" *************** *** 646,661 **** syserror() { - register int e = errno; - extern int sys_nerr; - extern char *sys_errlist[]; dirtcnt = 0; putchar(' '); ! if (e >= 0 && e <= sys_nerr) ! error("%s", sys_errlist[e]); ! else ! error("System error %d", e); } /* --- 646,655 ---- syserror() { dirtcnt = 0; putchar(' '); ! error("%s", strerror(errno)); } /* *** /usr/src/ucb/ex/exrecover.c.old Sun Sep 8 12:06:04 1991 --- /usr/src/ucb/ex/exrecover.c Fri Mar 22 17:31:38 1996 *************** *** 9,15 **** "@(#) Copyright (c) 1980 Regents of the University of California.\n\ All rights reserved.\n"; ! static char *sccsid = "@(#)exrecover.c 7.9 (Berkeley) 6/7/85"; #endif #include <stdio.h> /* mjm: BUFSIZ: stdio = 512, VMUNIX = 1024 */ --- 9,15 ---- "@(#) Copyright (c) 1980 Regents of the University of California.\n\ All rights reserved.\n"; ! static char *sccsid = "@(#)exrecover.c 7.9.1 (2.11BSD) 1996/3/22"; #endif #include <stdio.h> /* mjm: BUFSIZ: stdio = 512, VMUNIX = 1024 */ *************** *** 756,770 **** syserror() { - extern int sys_nerr; - extern char *sys_errlist[]; dirtcnt = 0; write(2, " ", 1); ! if (errno >= 0 && errno <= sys_nerr) ! error("%s", sys_errlist[errno]); ! else ! error("System error %d", errno); exit(1); } --- 756,765 ---- syserror() { dirtcnt = 0; write(2, " ", 1); ! error("%s", strerror(errno)); exit(1); } *** /usr/src/ucb/pascal/pi/Makefile.old Sat Jan 27 18:40:27 1996 --- /usr/src/ucb/pascal/pi/Makefile Fri Mar 22 18:16:30 1996 *************** *** 1,5 **** # ! # pi Makefile - 1.1 1996/1/27 # DESTDIR= --- 1,5 ---- # ! # pi Makefile - 1.2 1996/3/22 # DESTDIR= *************** *** 49,55 **** ERRORSTRINGS= pi1.2strings ALL= ${INSTALL} ${UTILS} ${ERRORSTRINGS} ! all: ${ALL} .c.o: rm -f ${TEMPDIR}/$*.c --- 49,58 ---- ERRORSTRINGS= pi1.2strings ALL= ${INSTALL} ${UTILS} ${ERRORSTRINGS} ! all: ${TEMPDIR} ${ALL} ! ! tmp: ! -mkdir tmp .c.o: rm -f ${TEMPDIR}/$*.c *** /usr/src/ucb/pascal/pi/subr.c.old Fri Jul 10 13:58:45 1981 --- /usr/src/ucb/pascal/pi/subr.c Fri Mar 22 18:19:15 1996 *************** *** 1,4 **** ! /* @(#)subr.c 2.3 SCCS id keyword */ /* Copyright (c) 1979 Regents of the University of California */ #include "whoami" /* --- 1,4 ---- ! /* @(#)subr.c 2.3.1 (2.11BSD) 1996/3/21 */ /* Copyright (c) 1979 Regents of the University of California */ #include "whoami" /* *************** *** 96,102 **** #endif extern int errno; - extern char *sys_errlist[]; /* * Boom! --- 96,101 ---- *** /usr/src/ucb/pascal/px/int.c.old Sat May 31 15:03:44 1986 --- /usr/src/ucb/pascal/px/int.c Fri Mar 22 18:50:01 1996 *************** *** 4,14 **** --- 4,18 ---- * Version 1.0 August 1977 * * Bill Joy, Charles Haley, Ken Thompson + * + * 1996/3/22 - make Perror look like that in ../pi/subr.c */ #include "0x.h" #include "opcode.h" #include "E.h" + #include <sys/types.h> + #include <sys/uio.h> int display[20] = { display }; *************** *** 108,122 **** interpret(bp, size); } Perror(file, mesg) char *file, *mesg; { ! extern int errno; ! extern char *sys_errlist[]; ! errno = 0; ! sys_errlist[0] = mesg; ! perror(file); } /* --- 112,136 ---- interpret(bp, size); } + /* + * Can't use 'fprintf(stderr...)' because that would require stdio.h and + * that can't be used because the 'ferror' macro would conflict with the routine + * of the same name. But we don't want to use sys_errlist[] because that's + * ~2kb of D space. + */ + Perror(file, mesg) char *file, *mesg; { ! struct iovec iov[3]; ! iov[0].iov_base = file; ! iov[0].iov_len = strlen(file); ! iov[1].iov_base = ": "; ! iov[1].iov_len = 2; ! iov[2].iov_base = mesg; ! iov[2].iov_len = strlen(mesg); ! writev(2, iov, 3); } /* *** /usr/src/ucb/pascal/pxp/subr.c.old Sat Jul 25 11:40:47 1987 --- /usr/src/ucb/pascal/pxp/subr.c Fri Mar 22 19:09:07 1996 *************** *** 9,17 **** --- 9,21 ---- * * Bill Joy UCB * Version 1.2 January 1979 + * + * 1996/3/22 - make Perror look like that in ../pi/subr.c */ #include "0.h" + #include <sys/types.h> + #include <sys/uio.h> #ifndef PI1 /* *************** *** 90,108 **** } #endif - extern int errno; - extern char *sys_errlist[]; - /* * Boom! ! */ ! Perror(file, error) ! char *file, *error; { ! errno = 0; ! sys_errlist[0] = error; ! perror(file); } calloc(num, size) --- 94,120 ---- } #endif /* * Boom! ! * ! * Can't use 'fprintf(stderr...)' because that would require stdio.h and ! * that can't be used because the 'ferror' macro would conflict with the routine ! * of the same name. But we don't want to use sys_errlist[] because that's ! * ~2kb of D space. ! */ ! ! Perror(file, mesg) ! char *file, *mesg; { + struct iovec iov[3]; ! iov[0].iov_base = file; ! iov[0].iov_len = strlen(file); ! iov[1].iov_base = ": "; ! iov[1].iov_len = 2; ! iov[2].iov_base = mesg; ! iov[2].iov_len = strlen(mesg); ! writev(2, iov, 3); } calloc(num, size) *************** *** 121,169 **** return (p1); } - /* - * Compare strings: s1>s2: >0 s1==s2: 0 s1<s2: <0 - */ - strcmp(s1, s2) - register char *s1, *s2; - { - - while (*s1 == *s2++) - if (*s1++=='\0') - return (0); - return (*s1 - *--s2); - } - - /* - * Copy string s2 to s1. - * S1 must be large enough. - * Return s1. - */ - strcpy(s1, s2) - register char *s1, *s2; - { - register os1; - - os1 = s1; - while (*s1++ = *s2++) - continue; - return (os1); - } - - /* - * Strlen is currently a freebie of perror - * Take the length of a string. - * Note that this does not include the trailing null! - strlen(cp) - register char *cp; - { - register int i; - - for (i = 0; *cp != 0; cp++) - i++; - return (i); - } - */ copy(to, from, bytes) register char *to, *from; register int bytes; --- 133,138 ---- *** /usr/src/ucb/rdist/defs.h.old Tue May 9 23:01:23 1995 --- /usr/src/ucb/rdist/defs.h Fri Mar 22 18:01:58 1996 *************** *** 3,14 **** * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)defs.h 5.2.2 (2.11BSD GTE) 1995/05/09 */ #include <stdio.h> #include <ctype.h> #include <errno.h> #include <pwd.h> #include <grp.h> #include <sys/param.h> --- 3,15 ---- * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)defs.h 5.2.3 (2.11BSD GTE) 1996/3/22 */ #include <stdio.h> #include <ctype.h> #include <errno.h> + #include <string.h> #include <pwd.h> #include <grp.h> #include <sys/param.h> *************** *** 116,123 **** extern struct group *gr; /* pointer to static area used by getgrent */ extern char host[]; /* host name of master copy */ extern char buf[]; /* general purpose buffer */ - extern int errno; /* system error number */ - extern char *strerror(); char *makestr(); struct namelist *makenl(); --- 117,122 ---- *************** *** 126,130 **** struct namelist *expand(); char *exptilde(); char *malloc(); - char *rindex(); - char *index(); --- 125,127 ---- *** /usr/src/ucb/talk/io.c.old Tue Aug 2 15:33:50 1988 --- /usr/src/ucb/talk/io.c Fri Mar 22 20:17:46 1996 *************** *** 4,12 **** * specifies the terms and conditions for redistribution. */ ! #ifndef lint ! static char sccsid[] = "@(#)io.c 5.1 (Berkeley) 6/6/85"; ! #endif not lint /* * This file contains the I/O handling and the exchange of --- 4,12 ---- * specifies the terms and conditions for redistribution. */ ! #if !defined(lint) && defined(DOSCCS) ! static char sccsid[] = "@(#)io.c 5.1.1 (2.11BSD) 1996/3/22"; ! #endif /* * This file contains the I/O handling and the exchange of *************** *** 17,22 **** --- 17,23 ---- #include "talk.h" #include <stdio.h> #include <errno.h> + #include <string.h> #include <sys/time.h> #define A_LONG_TIME 10000000 *************** *** 82,91 **** } } - extern int errno; - extern int sys_nerr; - extern char *sys_errlist[]; - /* * p_error prints the system error message on the standard location * on the screen and then exits. (i.e. a curses version of perror) --- 83,88 ---- *************** *** 95,103 **** { char *sys; ! sys = "Unknown error"; ! if (errno < sys_nerr) ! sys = sys_errlist[errno]; wmove(my_win.x_win, current_line%my_win.x_nlines, 0); wprintw(my_win.x_win, "[%s : %s (%d)]\n", string, sys, errno); wrefresh(my_win.x_win); --- 92,98 ---- { char *sys; ! sys = strerror(errno); wmove(my_win.x_win, current_line%my_win.x_nlines, 0); wprintw(my_win.x_win, "[%s : %s (%d)]\n", string, sys, errno); wrefresh(my_win.x_win); *** /usr/src/ucb/window/context.c.old Tue Jun 14 09:43:38 1988 --- /usr/src/ucb/window/context.c Fri Mar 22 19:28:11 1996 *************** *** 1,5 **** ! #ifndef lint ! static char sccsid[] = "@(#)context.c 3.7 4/24/85"; #endif /* --- 1,5 ---- ! #if !defined(lint) && defined(DOSCCS) ! static char sccsid[] = "@(#)context.c 3.7.1 1996/3/22"; #endif /* *************** *** 17,24 **** /* * Context push/pop for nested command files. */ - - char *malloc(); cx_alloc() { --- 17,22 ---- *** /usr/src/ucb/window/ttinit.c.old Tue Jun 14 09:43:39 1988 --- /usr/src/ucb/window/ttinit.c Fri Mar 22 19:35:00 1996 *************** *** 1,5 **** ! #ifndef lint ! static char sccsid[] = "@(#)ttinit.c 3.14 4/24/85"; #endif /* --- 1,5 ---- ! #if !defined(lint) && defined(DOSCCS) ! static char sccsid[] = "@(#)ttinit.c 3.14.1 1996/3/22"; #endif /* *************** *** 50,56 **** p++; for (q = p; *q && *q != '|' && *q != ':'; q++) ; ! if (q != p && (t = malloc((unsigned) (q - p + 1))) != 0) { wwterm = t; while (p < q) *t++ = *p++; --- 50,56 ---- p++; for (q = p; *q && *q != '|' && *q != ':'; q++) ; ! if (q != p && (t = (char *)malloc((unsigned) (q - p + 1))) != 0) { wwterm = t; while (p < q) *t++ = *p++; *** /usr/src/ucb/window/ww.h.old Sat Jan 1 01:57:55 1994 --- /usr/src/ucb/window/ww.h Fri Mar 22 19:24:14 1996 *************** *** 1,5 **** /* ! * @(#)ww.h 3.37 5/2/86 */ /* --- 1,5 ---- /* ! * @(#)ww.h 3.37.1 1996/3/22 */ /* *************** *** 10,15 **** --- 10,18 ---- #include <sgtty.h> #include <setjmp.h> + #include <stdlib.h> + #include <string.h> + #include <errno.h> #ifdef pdp11 #define NWW 9 /* maximum number of windows */ *************** *** 247,260 **** char *wwerror(); /* c library functions */ - char *malloc(); - char *calloc(); - char *getenv(); char *tgetstr(); - char *rindex(); - char *strcpy(); - char *strcat(); - char *sprintf(); #undef MIN #undef MAX --- 250,256 ---- *** /usr/src/ucb/window/wwerror.c.old Mon Feb 16 22:10:55 1987 --- /usr/src/ucb/window/wwerror.c Fri Mar 22 19:23:56 1996 *************** *** 1,5 **** ! #ifndef lint ! static char sccsid[] = "@(#)wwerror.c 3.3 4/24/85"; #endif /* --- 1,5 ---- ! #if !defined(lint) && defined(DOSCCS) ! static char sccsid[] = "@(#)wwerror.c 3.3.1 1996/3/22"; #endif /* *************** *** 14,26 **** wwerror() { extern errno; - extern char *sys_errlist[]; switch (wwerrno) { case WWE_NOERR: return "No error"; case WWE_SYS: ! return sys_errlist[errno]; case WWE_NOMEM: return "Out of memory"; case WWE_TOOMANY: --- 14,25 ---- wwerror() { extern errno; switch (wwerrno) { case WWE_NOERR: return "No error"; case WWE_SYS: ! return strerror(errno); case WWE_NOMEM: return "Out of memory"; case WWE_TOOMANY: *** /usr/src/ucb/window/wwinit.c.old Mon Feb 16 22:10:48 1987 --- /usr/src/ucb/window/wwinit.c Fri Mar 22 19:39:52 1996 *************** *** 1,5 **** ! #ifndef lint ! static char sccsid[] = "@(#)wwinit.c 3.26 5/1/86"; #endif /* --- 1,5 ---- ! #if !defined(lint) && defined(DOSCCS) ! static char sccsid[] = "@(#)wwinit.c 3.26.1 1996/3/22"; #endif /* *************** *** 81,87 **** else if (wwavailmodes & WWM_UL) wwcursormodes = WWM_UL; ! if ((wwib = malloc((unsigned) 512)) == 0) goto bad; wwibe = wwib + 512; wwibq = wwibp = wwib; --- 81,87 ---- else if (wwavailmodes & WWM_UL) wwcursormodes = WWM_UL; ! if ((wwib = (char *)malloc((unsigned) 512)) == 0) goto bad; wwibe = wwib + 512; wwibq = wwibp = wwib; *************** *** 107,113 **** for (j = 0; j < wwncol; j++) wwns[i][j].c_w = ' '; ! wwtouched = malloc((unsigned) wwnrow); if (wwtouched == 0) { wwerrno = WWE_NOMEM; goto bad; --- 107,113 ---- for (j = 0; j < wwncol; j++) wwns[i][j].c_w = ' '; ! wwtouched = (char *)malloc((unsigned) wwnrow); if (wwtouched == 0) { wwerrno = WWE_NOMEM; goto bad; *** /usr/src/ucb/window/wwopen.c.old Tue Jun 14 09:54:10 1988 --- /usr/src/ucb/window/wwopen.c Fri Mar 22 19:42:27 1996 *************** *** 1,5 **** ! #ifndef lint ! static char sccsid[] = "@(#)wwopen.c 3.21 4/24/85"; #endif /* --- 1,5 ---- ! #if !defined(lint) && defined(DOSCCS) ! static char sccsid[] = "@(#)wwopen.c 3.21.1 1996/3/22"; #endif /* *************** *** 88,94 **** w->ww_socket = d[1]; } if (flags & (WWO_PTY|WWO_SOCKET)) { ! if ((w->ww_ob = malloc(512)) == 0) { wwerrno = WWE_NOMEM; goto bad; } --- 88,94 ---- w->ww_socket = d[1]; } if (flags & (WWO_PTY|WWO_SOCKET)) { ! if ((w->ww_ob = (char *)malloc(512)) == 0) { wwerrno = WWE_NOMEM; goto bad; } *** /usr/src/usr.bin/Makefile.old Fri Feb 23 20:33:28 1996 --- /usr/src/usr.bin/Makefile Wed Mar 20 21:54:19 1996 *************** *** 1,4 **** ! # Makefile 1.3 (2.11BSD GTE) 1996/02/23 # DESTDIR= CFLAGS= -O --- 1,4 ---- ! # Makefile 1.4 (2.11BSD GTE) 1996/03/20 # DESTDIR= CFLAGS= -O *************** *** 8,13 **** --- 8,14 ---- # SUBDIR= at calendar dc diction diff3 eqn f77 find graph learn lex lint \ m4 neqn plot printf prof ranlib ratfor refer roff spell struct tbl \ + mkerrlst \ tip uucp uname yacc xargs xinstall # Shell scripts that need only be installed and are never removed. *** /usr/src/usr.bin/file.c.old Wed Dec 19 10:28:00 1990 --- /usr/src/usr.bin/file.c Fri Mar 22 21:07:16 1996 *************** *** 1,6 **** ! #ifndef lint ! /* static char sccsid[] = "@(#)file.c 4.12 (Berkeley) 11/17/85"; */ ! static char sccsid[] = "@(#)file.c 2.11BSD (Contel) 11/24/90"; #endif /* * file - determine type of file --- 1,5 ---- ! #if !defined(lint) && defined(DOSCCS) ! static char sccsid[] = "@(#)file.c 4.12.2 (2.11BSD) 1996/3/22"; #endif /* * file - determine type of file *************** *** 11,19 **** #include <stdio.h> #include <ctype.h> #include <a.out.h> ! int errno; ! int sys_nerr; ! char *sys_errlist[]; int in; int i = 0; char buf[BUFSIZ]; --- 10,18 ---- #include <stdio.h> #include <ctype.h> #include <a.out.h> ! #include <errno.h> ! #include <string.h> ! int in; int i = 0; char buf[BUFSIZ]; *************** *** 87,94 **** ifile = -1; if (lstat(file, &mbuf) < 0) { ! printf("%s\n", ! (unsigned)errno < sys_nerr? sys_errlist[errno]: "Cannot stat"); return; } switch (mbuf.st_mode & S_IFMT) { --- 86,92 ---- ifile = -1; if (lstat(file, &mbuf) < 0) { ! printf("%s\n", strerror(errno)); return; } switch (mbuf.st_mode & S_IFMT) { *************** *** 123,130 **** ifile = open(file, 0); if(ifile < 0) { ! printf("%s\n", ! (unsigned)errno < sys_nerr? sys_errlist[errno]: "Cannot read"); return; } in = read(ifile, buf, BUFSIZ); --- 121,127 ---- ifile = open(file, 0); if(ifile < 0) { ! printf("%s\n", strerror(errno)); return; } in = read(ifile, buf, BUFSIZ); *** /usr/src/usr.bin/uucp/acucntrl.c.old Mon Jan 10 22:48:07 1994 --- /usr/src/usr.bin/uucp/acucntrl.c Fri Mar 22 20:25:18 1996 *************** *** 1,5 **** #if defined(DOSCCS) && !defined(lint) ! static char sccsid[] = "@(#)acucntrl.c 5.8.1 (2.11BSD GTE) 1/1/94"; #endif /* acucntrl - turn around tty line between dialin and dialout --- 1,5 ---- #if defined(DOSCCS) && !defined(lint) ! static char sccsid[] = "@(#)acucntrl.c 5.8.2 (2.11BSD GTE) 1996/3/22"; #endif /* acucntrl - turn around tty line between dialin and dialout *************** *** 65,70 **** --- 65,72 ---- #include <pwd.h> #include <stdio.h> #include <sys/file.h> + #include <errno.h> + #include <string.h> #define NDZLINE 8 /* lines/dz */ #define NDHLINE 16 /* lines/dh */ *************** *** 130,138 **** off_t utmploc; off_t ttyslnbeg; - extern int errno; - extern char *sys_errlist[]; - #define NAMSIZ sizeof(utmp.ut_name) #define LINSIZ sizeof(utmp.ut_line) --- 132,137 ---- *************** *** 183,189 **** /* Chdir to /dev */ if(chdir(Devhome) < 0) { fprintf(stderr, "Cannot chdir to %s: %s\r\n", ! Devhome, sys_errlist[errno]); exit(1); } --- 182,188 ---- /* Chdir to /dev */ if(chdir(Devhome) < 0) { fprintf(stderr, "Cannot chdir to %s: %s\r\n", ! Devhome, strerror(errno)); exit(1); } *************** *** 209,215 **** /* check to see if line is being used */ if( (etcutmp = open(Etcutmp, 2)) < 0) { fprintf(stderr, "On open %s open: %s\n", ! Etcutmp, sys_errlist[errno]); exit(1); } --- 208,214 ---- /* check to see if line is being used */ if( (etcutmp = open(Etcutmp, 2)) < 0) { fprintf(stderr, "On open %s open: %s\n", ! Etcutmp, strerror(errno)); exit(1); } *************** *** 242,248 **** if (enable) { if((devfile = open(device, 1)) < 0) { fprintf(stderr, "On open of %s: %s\n", ! device, sys_errlist[errno]); (void)setmodem(device, resetmodem); exit(1); } --- 241,247 ---- if (enable) { if((devfile = open(device, 1)) < 0) { fprintf(stderr, "On open of %s: %s\n", ! device, strerror(errno)); (void)setmodem(device, resetmodem); exit(1); } *************** *** 249,265 **** /* Try one last time to hang up */ if (ioctl(devfile, TIOCCDTR, (char *)0) < 0) fprintf(stderr, "On TIOCCDTR ioctl: %s\n", ! sys_errlist[errno]); if (ioctl(devfile, TIOCNXCL, (char *)0) < 0) fprintf(stderr, "Cannot clear Exclusive Use on %s: %s\n", ! device, sys_errlist[errno]); if (ioctl(devfile, TIOCHPCL, (char *)0) < 0) fprintf(stderr, "Cannot set hangup on close on %s: %s\n", ! device, sys_errlist[errno]); i = resetmodem; --- 248,264 ---- /* Try one last time to hang up */ if (ioctl(devfile, TIOCCDTR, (char *)0) < 0) fprintf(stderr, "On TIOCCDTR ioctl: %s\n", ! strerror(errno)); if (ioctl(devfile, TIOCNXCL, (char *)0) < 0) fprintf(stderr, "Cannot clear Exclusive Use on %s: %s\n", ! device, strerror(errno)); if (ioctl(devfile, TIOCHPCL, (char *)0) < 0) fprintf(stderr, "Cannot set hangup on close on %s: %s\n", ! device, strerror(errno)); i = resetmodem; *************** *** 287,293 **** if((devfile = open(device, 1)) < 0) { fprintf(stderr, "On open of %s: %s\n", ! device, sys_errlist[errno]); (void)setmodem(device, resetmodem); exit(1); } --- 286,292 ---- if((devfile = open(device, 1)) < 0) { fprintf(stderr, "On open of %s: %s\n", ! device, strerror(errno)); (void)setmodem(device, resetmodem); exit(1); } *************** *** 306,312 **** /* chown device */ if(chown(device, uid, gid) < 0) fprintf(stderr, "Cannot chown %s: %s\n", ! device, sys_errlist[errno]); /* poke init */ --- 305,311 ---- /* chown device */ if(chown(device, uid, gid) < 0) fprintf(stderr, "Cannot chown %s: %s\n", ! device, strerror(errno)); /* poke init */ *************** *** 318,329 **** post(device, Uname); if((devfile = open(device, O_RDWR|O_NDELAY)) < 0) { fprintf(stderr, "On %s open: %s\n", ! device, sys_errlist[errno]); } else { if(ioctl(devfile, TIOCSDTR, (char *)0) < 0) fprintf(stderr, "Cannot set DTR on %s: %s\n", ! device, sys_errlist[errno]); } } --- 317,328 ---- post(device, Uname); if((devfile = open(device, O_RDWR|O_NDELAY)) < 0) { fprintf(stderr, "On %s open: %s\n", ! device, strerror(errno)); } else { if(ioctl(devfile, TIOCSDTR, (char *)0) < 0) fprintf(stderr, "Cannot set DTR on %s: %s\n", ! device, strerror(errno)); } } *************** *** 350,359 **** strncpy(utmp.ut_name, name, NAMSIZ); if (lseek(etcutmp, utmploc, 0) < 0) fprintf(stderr, "on lseek in /etc/utmp: %s", ! sys_errlist[errno]); if (write(etcutmp, (char *)&utmp, sizeof(utmp)) < 0) fprintf(stderr, "on write in /etc/utmp: %s", ! sys_errlist[errno]); } /* poke process 1 and wait for it to do its thing */ --- 349,358 ---- strncpy(utmp.ut_name, name, NAMSIZ); if (lseek(etcutmp, utmploc, 0) < 0) fprintf(stderr, "on lseek in /etc/utmp: %s", ! strerror(errno)); if (write(etcutmp, (char *)&utmp, sizeof(utmp)) < 0) fprintf(stderr, "on write in /etc/utmp: %s", ! strerror(errno)); } /* poke process 1 and wait for it to do its thing */ *************** *** 369,375 **** if (kill(1, SIGHUP)) { fprintf(stderr, "Cannot send hangup to init process: %s\n", ! sys_errlist[errno]); (void)settys(resettty); (void)setmodem(device, resetmodem); exit(1); --- 368,374 ---- if (kill(1, SIGHUP)) { fprintf(stderr, "Cannot send hangup to init process: %s\n", ! strerror(errno)); (void)settys(resettty); (void)setmodem(device, resetmodem); exit(1); *************** *** 384,393 **** sleep(1); if (lseek(etcutmp, utmploc, 0) < 0) fprintf(stderr, "On lseek in /etc/utmp: %s", ! sys_errlist[errno]); if (read(etcutmp, (char *)&utmp, sizeof utmp) < 0) fprintf(stderr, "On read from /etc/utmp: %s", ! sys_errlist[errno]); } while (utmp.ut_name[0] != '\0' && --i > 0); } --- 383,392 ---- sleep(1); if (lseek(etcutmp, utmploc, 0) < 0) fprintf(stderr, "On lseek in /etc/utmp: %s", ! strerror(errno)); if (read(etcutmp, (char *)&utmp, sizeof utmp) < 0) fprintf(stderr, "On read from /etc/utmp: %s", ! strerror(errno)); } while (utmp.ut_name[0] != '\0' && --i > 0); } *************** *** 410,416 **** ttysfile = fopen(Etcttys, "r"); if(ttysfile == NULL) { fprintf(stderr, "Cannot open %s: %s\n", Etcttys, ! sys_errlist[errno]); exit(1); } } while (flock(fileno(ttysfile), LOCK_NB|LOCK_EX) < 0); --- 409,415 ---- ttysfile = fopen(Etcttys, "r"); if(ttysfile == NULL) { fprintf(stderr, "Cannot open %s: %s\n", Etcttys, ! strerror(errno)); exit(1); } } while (flock(fileno(ttysfile), LOCK_NB|LOCK_EX) < 0); *************** *** 417,423 **** nttysfile = fopen(NEtcttys, "w"); if(nttysfile == NULL) { fprintf(stderr, "Cannot open %s: %s\n", Etcttys, ! sys_errlist[errno]); exit(1); } --- 416,422 ---- nttysfile = fopen(NEtcttys, "w"); if(nttysfile == NULL) { fprintf(stderr, "Cannot open %s: %s\n", Etcttys, ! strerror(errno)); exit(1); } *************** *** 436,442 **** utmploc += sizeof(utmp); if (fputs(linebuf, nttysfile) == NULL) { fprintf(stderr, "On %s write: %s\n", ! Etcttys, sys_errlist[errno]); exit(1); } --- 435,441 ---- utmploc += sizeof(utmp); if (fputs(linebuf, nttysfile) == NULL) { fprintf(stderr, "On %s write: %s\n", ! Etcttys, strerror(errno)); exit(1); } *************** *** 457,463 **** (void) fseek(ttysfile, ttyslnbeg, 0); if(fgets(lbuf, BUFSIZ, ttysfile) == NULL) { fprintf(stderr, "On %s read: %s\n", ! Etcttys, sys_errlist[errno]); exit(1); } /* format is now */ --- 456,462 ---- (void) fseek(ttysfile, ttyslnbeg, 0); if(fgets(lbuf, BUFSIZ, ttysfile) == NULL) { fprintf(stderr, "On %s read: %s\n", ! Etcttys, strerror(errno)); exit(1); } /* format is now */ *************** *** 499,511 **** fprintf(nttysfile,"%s%c%s%c%s", lbuf, c1, enable ? "on" : "off", c2, cp); if (ferror(nttysfile)) { fprintf(stderr, "On %s fprintf: %s\n", ! NEtcttys, sys_errlist[errno]); exit(1); } while(fgets(lbuf, sizeof(lbuf) - 1, ttysfile) != NULL) { if (fputs(lbuf, nttysfile) == NULL) { fprintf(stderr, "On %s write: %s\n", ! NEtcttys, sys_errlist[errno]); exit(1); } } --- 498,510 ---- fprintf(nttysfile,"%s%c%s%c%s", lbuf, c1, enable ? "on" : "off", c2, cp); if (ferror(nttysfile)) { fprintf(stderr, "On %s fprintf: %s\n", ! NEtcttys, strerror(errno)); exit(1); } while(fgets(lbuf, sizeof(lbuf) - 1, ttysfile) != NULL) { if (fputs(lbuf, nttysfile) == NULL) { fprintf(stderr, "On %s write: %s\n", ! NEtcttys, strerror(errno)); exit(1); } } *************** *** 540,546 **** ttysfile = fopen(Etcttys, "r"); if(ttysfile == NULL) { fprintf(stderr, "Cannot open %s: %s\n", Etcttys, ! sys_errlist[errno]); exit(1); } --- 539,545 ---- ttysfile = fopen(Etcttys, "r"); if(ttysfile == NULL) { fprintf(stderr, "Cannot open %s: %s\n", Etcttys, ! strerror(errno)); exit(1); } *************** *** 573,585 **** ittysfil = open(Etcttys, 2); if(ittysfil < 0) { fprintf(stderr, "Cannot open %s for output: %s\n", ! Etcttys, sys_errlist[errno]); exit(1); } (void)lseek(ittysfil, ttyslnbeg, 0); if(read(ittysfil, &in, 1)<0) { fprintf(stderr, "On %s write: %s\n", ! Etcttys, sys_errlist[errno]); exit(1); } resettty = (in == '1'); --- 572,584 ---- ittysfil = open(Etcttys, 2); if(ittysfil < 0) { fprintf(stderr, "Cannot open %s for output: %s\n", ! Etcttys, strerror(errno)); exit(1); } (void)lseek(ittysfil, ttyslnbeg, 0); if(read(ittysfil, &in, 1)<0) { fprintf(stderr, "On %s write: %s\n", ! Etcttys, strerror(errno)); exit(1); } resettty = (in == '1'); *************** *** 587,593 **** (void)lseek(ittysfil, ttyslnbeg, 0); if(write(ittysfil, &out, 1)<0) { fprintf(stderr, "On %s write: %s\n", ! Etcttys, sys_errlist[errno]); exit(1); } (void)close(ittysfil); --- 586,592 ---- (void)lseek(ittysfil, ttyslnbeg, 0); if(write(ittysfil, &out, 1)<0) { fprintf(stderr, "On %s write: %s\n", ! Etcttys, strerror(errno)); exit(1); } (void)close(ittysfil); *************** *** 648,659 **** } if((kmem = open("/dev/kmem", 2)) < 0) { ! fprintf(stderr, "/dev/kmem open: %s\n", sys_errlist[errno]); return(-1); } if(stat(ttyline, &statb) < 0) { ! fprintf(stderr, "%s stat: %s\n", ttyline, sys_errlist[errno]); return(-1); } --- 647,658 ---- } if((kmem = open("/dev/kmem", 2)) < 0) { ! fprintf(stderr, "/dev/kmem open: %s\n", strerror(errno)); return(-1); } if(stat(ttyline, &statb) < 0) { ! fprintf(stderr, "%s stat: %s\n", ttyline, strerror(errno)); return(-1); } *** /usr/src/usr.bin/uucp/aculib/bsdtcp.c.old Mon Jan 10 22:47:48 1994 --- /usr/src/usr.bin/uucp/aculib/bsdtcp.c Fri Mar 22 20:21:49 1996 *************** *** 1,5 **** #if defined(DOSCCS) && !defined(lint) ! static char sccsid[] = "@(#)bsdtcp.c 4.3.1 (2.11BSD GTE) 1/1/94"; #endif #include "../condevs.h" --- 1,5 ---- #if defined(DOSCCS) && !defined(lint) ! static char sccsid[] = "@(#)bsdtcp.c 4.3.2 (2.11BSD GTE) 1996/3/22"; #endif #include "../condevs.h" *************** *** 24,30 **** struct sockaddr_in hisctladdr; int s = -1, port; extern int errno; - extern char *sys_errlist[]; sp = getservbyname(flds[F_CLASS], "tcp"); if (sp == NULL) { --- 24,29 ---- *************** *** 78,84 **** alarm(0); bsdtcpcls(s); DEBUG(5, "tcpopen failed: errno %d\n", errno); ! logent(sys_errlist[errno], _FAILED); return CF_DIAL; } --- 77,83 ---- alarm(0); bsdtcpcls(s); DEBUG(5, "tcpopen failed: errno %d\n", errno); ! logent(strerror(errno), _FAILED); return CF_DIAL; } *** /usr/src/usr.bin/uucp/condevs.c.old Mon Feb 16 16:21:44 1987 --- /usr/src/usr.bin/uucp/condevs.c Fri Mar 22 20:29:09 1996 *************** *** 1,10 **** ! #ifndef lint ! static char sccsid[] = "@(#)condevs.c 5.15 (Berkeley) 2/12/86"; #endif - extern int errno; - extern char *sys_errlist[]; - /* * Here are various dialers to establish the machine-machine connection. * conn.c/condevs.c was glued together by Mike Mitchell. --- 1,7 ---- ! #if !defined(lint) && defined(DOSCCS) ! static char sccsid[] = "@(#)condevs.c 5.15.1 (2.11BSD) 1996/3/22"; #endif /* * Here are various dialers to establish the machine-machine connection. * conn.c/condevs.c was glued together by Mike Mitchell. *************** *** 27,32 **** --- 24,30 ---- * THE FIX: Don't declare variables to be register */ + #include <string.h> #include "condevs.h" struct condev condevs[] = { *************** *** 437,451 **** { #ifdef USG if (ioctl(fn, TCSBRK, STBNULL) < 0) ! DEBUG(5, "break TCSBRK %s\n", sys_errlist[errno]); #else !USG # ifdef TIOCSBRK if (ioctl(fn, TIOCSBRK, STBNULL) < 0) ! DEBUG(5, "break TIOCSBRK %s\n", sys_errlist[errno]); # ifdef TIOCCBRK uucpdelay(bnulls, 10); if (ioctl(fn, TIOCCBRK, STBNULL) < 0) ! DEBUG(5, "break TIOCCBRK %s\n", sys_errlist[errno]); # endif TIOCCBRK DEBUG(4, "ioctl %f second break\n", (float) bnulls/10 ); # else !TIOCSBRK --- 435,449 ---- { #ifdef USG if (ioctl(fn, TCSBRK, STBNULL) < 0) ! DEBUG(5, "break TCSBRK %s\n", strerror(errno)); #else !USG # ifdef TIOCSBRK if (ioctl(fn, TIOCSBRK, STBNULL) < 0) ! DEBUG(5, "break TIOCSBRK %s\n", strerror(errno)); # ifdef TIOCCBRK uucpdelay(bnulls, 10); if (ioctl(fn, TIOCCBRK, STBNULL) < 0) ! DEBUG(5, "break TIOCCBRK %s\n", strerror(errno)); # endif TIOCCBRK DEBUG(4, "ioctl %f second break\n", (float) bnulls/10 ); # else !TIOCSBRK *************** *** 453,472 **** register int sospeed; if (ioctl(fn, TIOCGETP, &ttbuf) < 0) ! DEBUG(5, "break TIOCGETP %s\n", sys_errlist[errno]); sospeed = ttbuf.sg_ospeed; ttbuf.sg_ospeed = BSPEED; if (ioctl(fn, TIOCSETP, &ttbuf) < 0) ! DEBUG(5, "break TIOCSETP %s\n", sys_errlist[errno]); if (write(fn, "\0\0\0\0\0\0\0\0\0\0\0\0", bnulls) != bnulls) { badbreak: ! logent(sys_errlist[errno], "BAD WRITE genbrk"); alarm(0); longjmp(Sjbuf, 3); } ttbuf.sg_ospeed = sospeed; if (ioctl(fn, TIOCSETP, &ttbuf) < 0) ! DEBUG(5, "break ioctl %s\n", sys_errlist[errno]); if (write(fn, "@", 1) != 1) goto badbreak; DEBUG(4, "sent BREAK nulls - %d\n", bnulls); --- 451,470 ---- register int sospeed; if (ioctl(fn, TIOCGETP, &ttbuf) < 0) ! DEBUG(5, "break TIOCGETP %s\n", strerror(errno)); sospeed = ttbuf.sg_ospeed; ttbuf.sg_ospeed = BSPEED; if (ioctl(fn, TIOCSETP, &ttbuf) < 0) ! DEBUG(5, "break TIOCSETP %s\n", strerror(errno)); if (write(fn, "\0\0\0\0\0\0\0\0\0\0\0\0", bnulls) != bnulls) { badbreak: ! logent(strerror(errno), "BAD WRITE genbrk"); alarm(0); longjmp(Sjbuf, 3); } ttbuf.sg_ospeed = sospeed; if (ioctl(fn, TIOCSETP, &ttbuf) < 0) ! DEBUG(5, "break ioctl %s\n", strerror(errno)); if (write(fn, "@", 1) != 1) goto badbreak; DEBUG(4, "sent BREAK nulls - %d\n", bnulls); *** /usr/src/usr.bin/uucp/condevs.h.old Sat Jan 1 02:22:01 1994 --- /usr/src/usr.bin/uucp/condevs.h Fri Mar 22 20:31:55 1996 *************** *** 1,4 **** ! /* condevs.h 4.7 1/1/94 */ #include "uucp.h" #include <errno.h> --- 1,4 ---- ! /* condevs.h 4.7.1 1996/3/22 */ #include "uucp.h" #include <errno.h> *************** *** 14,20 **** #endif extern char devSel[]; /* name to pass to delock() in close */ ! extern int errno, next_fd; extern jmp_buf Sjbuf; extern int alarmtr(); int nulldev(), nodev(), Acuopn(), diropn(), dircls(); --- 14,20 ---- #endif extern char devSel[]; /* name to pass to delock() in close */ ! extern int next_fd; extern jmp_buf Sjbuf; extern int alarmtr(); int nulldev(), nodev(), Acuopn(), diropn(), dircls(); *** /usr/src/usr.bin/uucp/conn.c.old Mon Mar 9 07:00:14 1987 --- /usr/src/usr.bin/uucp/conn.c Fri Mar 22 20:30:18 1996 *************** *** 1,5 **** ! #ifndef lint ! static char sccsid[] = "@(#)conn.c 5.10 (Berkeley) 1/24/86"; #endif #include <signal.h> --- 1,5 ---- ! #if !defined(lint) && defined(DOSCCS) ! static char sccsid[] = "@(#)conn.c 5.10.1 (2.11BSD) 1996/3/22"; #endif #include <signal.h> *************** *** 24,31 **** extern jmp_buf Sjbuf; jmp_buf Cjbuf; ! extern int errno, onesys; ! extern char *sys_errlist[]; extern char MaxGrade, DefMaxGrade; /* Parity control during login procedure */ --- 24,30 ---- extern jmp_buf Sjbuf; jmp_buf Cjbuf; ! extern int onesys; extern char MaxGrade, DefMaxGrade; /* Parity control during login procedure */ *************** *** 276,282 **** */ #ifdef TIOCNXCL if (!IsTcpIp && Dcf >= 0 && ioctl(Dcf, TIOCNXCL, STBNULL) < 0) ! DEBUG(5, "clsacu ioctl %s\n", sys_errlist[errno]); #endif if (setjmp(Sjbuf)) logent(Rmtname, "CLOSE TIMEOUT"); --- 275,281 ---- */ #ifdef TIOCNXCL if (!IsTcpIp && Dcf >= 0 && ioctl(Dcf, TIOCNXCL, STBNULL) < 0) ! DEBUG(5, "clsacu ioctl %s\n", strerror(errno)); #endif if (setjmp(Sjbuf)) logent(Rmtname, "CLOSE TIMEOUT"); *************** *** 812,818 **** { c = par_tab[c&0177]; if (write(fd, &c, 1) != 1) { ! logent(sys_errlist[errno], "BAD WRITE"); longjmp(Cjbuf, 2); } } --- 811,817 ---- { c = par_tab[c&0177]; if (write(fd, &c, 1) != 1) { ! logent(strerror(errno), "BAD WRITE"); longjmp(Cjbuf, 2); } } *** /usr/src/usr.bin/uucp/pk1.c.old Sun Jul 3 21:19:20 1988 --- /usr/src/usr.bin/uucp/pk1.c Fri Mar 22 20:45:34 1996 *************** *** 1,5 **** ! #ifndef lint ! static char sccsid[] = "@(#)pk1.c 5.9 (Berkeley) 5/30/86"; #endif #include <signal.h> --- 1,5 ---- ! #if !defined(lint) && defined(DOSCCS) ! static char sccsid[] = "@(#)pk1.c 5.9.1 (2.11BSD) 1996/3/22"; #endif #include <signal.h> *************** *** 6,11 **** --- 6,13 ---- #include "uucp.h" #include "pk.h" #include <setjmp.h> + #include <errno.h> + #include <string.h> #ifdef BSD4_2 #include <sys/time.h> #endif BSD4_2 *************** *** 22,30 **** #define CONNODATA 10 #define MAXTIMEOUT 32 - extern int errno; extern int Retries; - extern char *sys_errlist[]; extern jmp_buf Sjbuf; extern char *malloc(); --- 24,30 ---- *************** *** 293,299 **** if (x < 0) { if(write(pk->p_ofn, p, HDRSIZ) != HDRSIZ) { alarm(0); ! logent("PKXSTART write failed", sys_errlist[errno]); longjmp(Sjbuf, 4); } } else { --- 293,299 ---- if (x < 0) { if(write(pk->p_ofn, p, HDRSIZ) != HDRSIZ) { alarm(0); ! logent("PKXSTART write failed", strerror(errno)); longjmp(Sjbuf, 4); } } else { *************** *** 310,316 **** if (write(pk->p_ofn, buf, pk->p_xsize + HDRSIZ + TAILSIZE) != (HDRSIZ + TAILSIZE + pk->p_xsize)) { alarm(0); ! logent("PKXSTART write failed", sys_errlist[errno]); longjmp(Sjbuf, 5); } Connodata = 0; --- 310,316 ---- if (write(pk->p_ofn, buf, pk->p_xsize + HDRSIZ + TAILSIZE) != (HDRSIZ + TAILSIZE + pk->p_xsize)) { alarm(0); ! logent("PKXSTART write failed", strerror(errno)); longjmp(Sjbuf, 5); } Connodata = 0; *************** *** 420,426 **** } if (ret <= 0) { alarm(0); ! logent(sys_errlist[errno],"FAILED pkcget Read"); longjmp(Sjbuf, 6); } b += ret; --- 420,426 ---- } if (ret <= 0) { alarm(0); ! logent(strerror(errno),"FAILED pkcget Read"); longjmp(Sjbuf, 6); } b += ret; *** /usr/src/usr.lib/Makefile.old Thu Oct 21 20:47:49 1993 --- /usr/src/usr.lib/Makefile Wed Mar 20 20:30:53 1996 *************** *** 3,9 **** # All rights reserved. The Berkeley software License Agreement # specifies the terms and conditions for redistribution. # ! # @(#)Makefile 5.11 (2.11BSD GTE) 10/21/93 # DESTDIR= CFLAGS= -O --- 3,9 ---- # All rights reserved. The Berkeley software License Agreement # specifies the terms and conditions for redistribution. # ! # @(#)Makefile 5.12 (2.11BSD GTE) 1996/3/20 # DESTDIR= CFLAGS= -O *************** *** 14,20 **** # master tags file (/usr/lib/tags); the Fortran libraries should # be on this list, but we don't control them.... # ! TAGSDIR=libcurses libdbm libln libm libmp libpc libtermlib libutil libvmf # Programs that live in subdirectories, and have makefiles of their own. # --- 14,21 ---- # master tags file (/usr/lib/tags); the Fortran libraries should # be on this list, but we don't control them.... # ! TAGSDIR=libcurses libdbm libln libm libmp libpc libtermlib libutil libvmf \ ! liberrlst # Programs that live in subdirectories, and have makefiles of their own. # *************** *** 22,28 **** # the 4.3BSD version of ucb/pascal. # SUBDIR= learn lib2648 libF77 libI77 libU77 libcurses libdbm libln \ ! libom libmp libplot libtermlib liby lpr me sendmail libutil libvmf # Shell scripts that need only be installed and are never removed. # --- 23,30 ---- # the 4.3BSD version of ucb/pascal. # SUBDIR= learn lib2648 libF77 libI77 libU77 libcurses libdbm libln \ ! libom libmp libplot libtermlib liby lpr me sendmail libutil libvmf \ ! liberrlst # Shell scripts that need only be installed and are never removed. # *** /usr/src/usr.lib/libI77/err.c.old Sun Dec 25 23:45:34 1988 --- /usr/src/usr.lib/libI77/err.c Fri Mar 22 21:14:39 1996 *************** *** 3,9 **** * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)err.c 5.2 7/30/85 */ /* --- 3,9 ---- * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)err.c 5.2.1 1996/3/22 */ /* *************** *** 47,59 **** /*error messages*/ - extern char *sys_errlist[]; - extern int sys_nerr; - extern char *f_errlist[]; extern int f_nerr; - fatal(n,s) char *s; { ftnint lu; --- 47,55 ---- *************** *** 62,73 **** flush_(&lu); if(n<0) fprintf(stderr,"%s: [%d] end of file\n",s,n); - else if(n>=0 && n<sys_nerr) - fprintf(stderr,"%s: [%d] %s\n",s,n,sys_errlist[n]); else if(n>=F_ER && n<F_MAXERR) fprintf(stderr,"%s: [%d] %s\n",s,n,f_errlist[n-F_ER]); else ! fprintf(stderr,"%s: [%d] unknown error number\n",s,n); if(external) { if(!lfname) switch (lunit) --- 58,67 ---- flush_(&lu); if(n<0) fprintf(stderr,"%s: [%d] end of file\n",s,n); else if(n>=F_ER && n<F_MAXERR) fprintf(stderr,"%s: [%d] %s\n",s,n,f_errlist[n-F_ER]); else ! fprintf(stderr,"%s: [%d] %s\n",s,n,strerror(n)); if(external) { if(!lfname) switch (lunit) *** /usr/src/usr.lib/libU77/gerror_.c.old Wed Feb 18 01:09:59 1987 --- /usr/src/usr.lib/libU77/gerror_.c Fri Mar 22 22:02:49 1996 *************** *** 3,9 **** * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)gerror_.c 5.1 6/7/85 */ /* --- 3,9 ---- * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)gerror_.c 5.1.1 1996/3/22 */ /* *************** *** 20,28 **** #include <stdio.h> #include "../libI77/f_errno.h" - extern char *sys_errlist[]; - extern int sys_nerr; extern char *f_errlist[]; extern int f_nerr; --- 20,27 ---- #include <stdio.h> #include "../libI77/f_errno.h" + #include <string.h> extern char *f_errlist[]; extern int f_nerr; *************** *** 31,41 **** { char *mesg; ! if (errno >=0 && errno < sys_nerr) ! mesg = sys_errlist[errno]; ! else if (errno >= F_ER && errno < (F_ER + f_nerr)) mesg = f_errlist[errno - F_ER]; else ! mesg = "unknown error number"; b_char(mesg, s, len); } --- 30,38 ---- { char *mesg; ! if (errno >= F_ER && errno < (F_ER + f_nerr)) mesg = f_errlist[errno - F_ER]; else ! mesg = strerror(errno); b_char(mesg, s, len); } *** /usr/src/usr.lib/libU77/perror_.c.old Wed Feb 18 01:09:55 1987 --- /usr/src/usr.lib/libU77/perror_.c Fri Mar 22 22:01:12 1996 *************** *** 3,9 **** * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)perror_.c 5.1 6/7/85 */ /* --- 3,9 ---- * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)perror_.c 5.1.1 1996/3/22 */ /* *************** *** 18,26 **** #include <stdio.h> #include "../libI77/fiodefs.h" #include "../libI77/f_errno.h" - extern char *sys_errlist[]; - extern int sys_nerr; extern char *f_errlist[]; extern int f_nerr; extern unit units[]; --- 18,25 ---- #include <stdio.h> #include "../libI77/fiodefs.h" #include "../libI77/f_errno.h" + #include <string.h> extern char *f_errlist[]; extern int f_nerr; extern unit units[]; *************** *** 28,52 **** perror_(s, len) char *s; long len; { ! unit *lu; ! char buf[40]; ! char *mesg = s + len; while (len > 0 && *--mesg == ' ') len--; ! if (errno >=0 && errno < sys_nerr) ! mesg = sys_errlist[errno]; ! else if (errno >= F_ER && errno < (F_ER + f_nerr)) mesg = f_errlist[errno - F_ER]; else ! { ! sprintf(buf, "%d: unknown error number", errno); ! mesg = buf; ! } lu = &units[STDERR]; if (!lu->uwrt) nowwriting(lu); while (len-- > 0) ! putc(*s++, lu->ufd); fprintf(lu->ufd, ": %s\n", mesg); } --- 27,45 ---- perror_(s, len) char *s; long len; { ! register unit *lu; ! register char *mesg = s + len; while (len > 0 && *--mesg == ' ') len--; ! if (errno >= F_ER && errno < (F_ER + f_nerr)) mesg = f_errlist[errno - F_ER]; else ! mesg = strerror(errno); lu = &units[STDERR]; if (!lu->uwrt) nowwriting(lu); while (len-- > 0) ! fputc(*s++, lu->ufd); fprintf(lu->ufd, ": %s\n", mesg); } *** /usr/src/usr.lib/lpr/startdaemon.c.old Mon Jan 10 23:09:34 1994 --- /usr/src/usr.lib/lpr/startdaemon.c Fri Mar 22 21:35:57 1996 *************** *** 5,11 **** */ #if defined(DOSCCS) && !defined(lint) ! static char sccsid[] = "@(#)startdaemon.c 5.1.1 (2.11BSD GTE) 1/1/94"; #endif /* --- 5,11 ---- */ #if defined(DOSCCS) && !defined(lint) ! static char sccsid[] = "@(#)startdaemon.c 5.1.2 (2.11BSD GTE) 1996/3/22"; #endif /* *************** *** 85,95 **** char *msg; { extern char *name; - extern int sys_nerr; - extern char *sys_errlist[]; - extern int errno; ! printf("%s: %s: ", name, msg); ! fputs(errno < sys_nerr ? sys_errlist[errno] : "Unknown error" , stdout); ! putchar('\n'); } --- 85,90 ---- char *msg; { extern char *name; ! printf("%s: %s: %s\n", name, msg, strerror(errno)); } *** /usr/src/usr.lib/sendmail.MX/src/err.c.old Sat Jan 1 01:12:38 1994 --- /usr/src/usr.lib/sendmail.MX/src/err.c Sat Mar 23 00:43:39 1996 *************** *** 15,21 **** */ #if !defined(lint) && !defined(NOSCCS) ! static char sccsid[] = "@(#)err.c 5.8.1 (2.11BSD) 1/1/94"; #endif # include "sendmail.h" --- 15,21 ---- */ #if !defined(lint) && !defined(NOSCCS) ! static char sccsid[] = "@(#)err.c 5.8.2 (2.11BSD) 1996/3/23"; #endif # include "sendmail.h" *************** *** 41,50 **** ** sets ExitStat. */ - # ifdef lint - int sys_nerr; - char *sys_errlist[]; - # endif lint #ifdef pdp11 char MsgBuf[BUFSIZ/2]; /* text of most recent message */ #else --- 41,46 ---- *************** *** 320,327 **** errstring(errno) int errno; { - extern char *sys_errlist[]; - extern int sys_nerr; static char buf[100]; # ifdef SMTP extern char *SmtpPhase; --- 316,321 ---- *************** *** 339,345 **** { case ETIMEDOUT: case ECONNRESET: ! (void) strcpy(buf, sys_errlist[errno]); if (SmtpPhase != NULL) { (void) strcat(buf, " during "); --- 333,339 ---- { case ETIMEDOUT: case ECONNRESET: ! (void) strcpy(buf, strerror(errno)); if (SmtpPhase != NULL) { (void) strcat(buf, " during "); *************** *** 371,379 **** # endif VMUNIX # endif DAEMON ! if (errno > 0 && errno < sys_nerr) ! return (sys_errlist[errno]); ! ! (void) sprintf(buf, "Error %d", errno); ! return (buf); } --- 365,369 ---- # endif VMUNIX # endif DAEMON ! return (strerror(errno)); } *** /usr/src/usr.lib/sendmail/src/Makefile.m4.old Thu Sep 7 23:11:18 1995 --- /usr/src/usr.lib/sendmail/src/Makefile.m4 Fri Mar 22 22:38:47 1996 *************** *** 7,13 **** # All rights reserved. The Berkeley software License Agreement # specifies the terms and conditions for redistribution. # ! # @(#)Makefile.m4 5.10.3 (2.11BSD GTE) 3/07/95 # # # SENDMAIL Makefile. --- 7,13 ---- # All rights reserved. The Berkeley software License Agreement # specifies the terms and conditions for redistribution. # ! # @(#)Makefile.m4 5.10.4 (2.11BSD GTE) 1996/3/22 # # # SENDMAIL Makefile. *************** *** 32,41 **** SBASE= conf.o parseaddr.o alias.o deliver.o headers.o \ recipient.o srvrsmtp.o queue.o util.o \ ! envelope.o sysexits.o arpadate.o convtime.o Version.o \ $(EXTRACT) str.o SOV1= main.o readcf.o macro.o ctime.o ! SOV2= daemon.o savemail.o usersmtp.o err.o clock.o stats.o trace.o stab.o SOV3= collect.o SRCS= \ --- 32,42 ---- SBASE= conf.o parseaddr.o alias.o deliver.o headers.o \ recipient.o srvrsmtp.o queue.o util.o \ ! envelope.o sysexits.o convtime.o Version.o \ $(EXTRACT) str.o SOV1= main.o readcf.o macro.o ctime.o ! SOV2= daemon.o savemail.o usersmtp.o err.o clock.o stats.o trace.o stab.o \ ! arpadate.o SOV3= collect.o SRCS= \ *** /VERSION.old Sun Mar 10 20:00:16 1996 --- /VERSION Sat Mar 30 21:51:29 1996 *************** *** 1,4 **** ! Current Patch Level: 308 2.11 BSD ============ --- 1,4 ---- ! Current Patch Level: 312 2.11 BSD ============