Index: include/util.h =================================================================== RCS file: /cvsroot/src/include/util.h,v retrieving revision 1.40 diff -u -u -r1.40 util.h --- include/util.h 18 Feb 2006 16:32:45 -0000 1.40 +++ include/util.h 25 Aug 2006 17:11:07 -0000 @@ -116,6 +116,23 @@ uint16_t disklabel_dkcksum(struct disklabel *); int disklabel_scan(struct disklabel *, char *, size_t); + +/* Error checked functions */ +void (*esetfunc(void (*)(int, const char *, ...))) + (int, const char *, ...); +size_t estrlcpy(char *, const char *, size_t); +size_t estrlcat(char *, const char *, size_t); +char *estrdup(const char *); +void *ecalloc(size_t, size_t); +void *emalloc(size_t); +void *erealloc(void *, size_t); +struct __sFILE *efopen(const char *, const char *); +int easprintf(char ** __restrict, const char * __restrict, ...) + __attribute__((__format__(__printf__, 2, 3))); +int evasprintf(char ** __restrict, const char * __restrict, + _BSD_VA_LIST_) + __attribute__((__format__(__printf__, 2, 0))); + __END_DECLS #endif /* !_UTIL_H_ */ Index: lib/libasn1/asn1_compile/Makefile =================================================================== RCS file: /cvsroot/src/lib/libasn1/asn1_compile/Makefile,v retrieving revision 1.19 diff -u -u -r1.19 Makefile --- lib/libasn1/asn1_compile/Makefile 10 Jan 2005 03:11:17 -0000 1.19 +++ lib/libasn1/asn1_compile/Makefile 25 Aug 2006 17:11:07 -0000 @@ -31,8 +31,7 @@ print_version.c \ warnerr.c \ strupr.c \ - get_window_size.c \ - emalloc.c + get_window_size.c SRCS= $(asn1_compile_SRCS) \ $(roken_SRCS) Index: lib/libroken/Makefile =================================================================== RCS file: /cvsroot/src/lib/libroken/Makefile,v retrieving revision 1.13 diff -u -u -r1.13 Makefile --- lib/libroken/Makefile 10 Jan 2005 03:11:17 -0000 1.13 +++ lib/libroken/Makefile 25 Aug 2006 17:11:11 -0000 @@ -11,16 +11,19 @@ LIB= roken +.if ${OBJECT_FMT} == "ELF" +LIBDPLIBS= util ${.CURDIR}/../libutil +.else +.PATH: ${NETBSDSRCDIR}/lib/libutil +SRCS+= efun.c +.endif + SRCS= \ base64.c \ concat.c \ - ecalloc.c \ - emalloc.c \ environment.c \ eread.c \ - erealloc.c \ esetenv.c \ - estrdup.c \ ewrite.c \ get_default_username.c \ get_window_size.c \ Index: lib/libutil/Makefile =================================================================== RCS file: /cvsroot/src/lib/libutil/Makefile,v retrieving revision 1.49 diff -u -u -r1.49 Makefile --- lib/libutil/Makefile 14 Sep 2005 18:45:40 -0000 1.49 +++ lib/libutil/Makefile 25 Aug 2006 17:11:11 -0000 @@ -8,7 +8,7 @@ WARNS=3 LIB= util CPPFLAGS+=-DLIBC_SCCS -SRCS= getbootfile.c getlabelsector.c getmaxpartitions.c \ +SRCS= efun.c getbootfile.c getlabelsector.c getmaxpartitions.c \ getmntopts.c getrawpartition.c \ disklabel_dkcksum.c disklabel_scan.c \ if_media.c \ @@ -17,7 +17,7 @@ passwd.c pw_scan.c pw_policy.c pidfile.c pidlock.c pty.c \ secure_path.c snprintb.c sockaddr_snprintf.c ttyaction.c ttymsg.c -MAN= getbootfile.3 getlabelsector.3 getmaxpartitions.3 \ +MAN= efun.3 getbootfile.3 getlabelsector.3 getmaxpartitions.3 \ getmntopts.3 \ getrawpartition.3 \ login.3 login_cap.3 loginx.3 \ @@ -55,5 +55,14 @@ MLINKS+=pw_lock.3 pw_setprefix.3 MLINKS+=pidlock.3 ttylock.3 MLINKS+=pidlock.3 ttyunlock.3 +MLINKS+=efun.3 esetfunc.3 +MLINKS+=efun.3 easprintf.3 +MLINKS+=efun.3 estrlcpy.3 +MLINKS+=efun.3 estrlcat.3 +MLINKS+=efun.3 estrdup.3 +MLINKS+=efun.3 emalloc.3 +MLINKS+=efun.3 erealloc.3 +MLINKS+=efun.3 efopen.3 +MLINKS+=efun.3 evasprintf.3 .include Index: lib/libutil/shlib_version =================================================================== RCS file: /cvsroot/src/lib/libutil/shlib_version,v retrieving revision 1.39 diff -u -u -r1.39 shlib_version --- lib/libutil/shlib_version 18 Feb 2006 10:52:48 -0000 1.39 +++ lib/libutil/shlib_version 25 Aug 2006 17:11:11 -0000 @@ -2,4 +2,4 @@ # Remember to update distrib/sets/lists/base/shl.* when changing # major=7 -minor=9 +minor=10 Index: libexec/makewhatis/Makefile =================================================================== RCS file: /cvsroot/src/libexec/makewhatis/Makefile,v retrieving revision 1.17 diff -u -u -r1.17 Makefile --- libexec/makewhatis/Makefile 18 May 2003 07:57:32 -0000 1.17 +++ libexec/makewhatis/Makefile 25 Aug 2006 17:11:12 -0000 @@ -10,8 +10,10 @@ MAN= ${PROG}.8 .ifndef HOSTPROG -DPADD= ${LIBZ} -LDADD= -lz +DPADD+= ${LIBZ} +LDADD+= -lz .endif +DPADD+= ${LIBUTIL} +LDADD+= -lutil .include Index: libexec/makewhatis/makewhatis.c =================================================================== RCS file: /cvsroot/src/libexec/makewhatis/makewhatis.c,v retrieving revision 1.39 diff -u -u -r1.39 makewhatis.c --- libexec/makewhatis/makewhatis.c 10 Apr 2006 14:39:06 -0000 1.39 +++ libexec/makewhatis/makewhatis.c 25 Aug 2006 17:11:12 -0000 @@ -67,6 +67,7 @@ #include #include #include +#include #include #include @@ -110,8 +111,6 @@ static char *getwhatisdata(char *); static void processmanpages(manpage **,whatis **); static void dumpwhatis(FILE *, whatis *); -static void *emalloc(size_t); -static char *estrdup(const char *); static int makewhatis(char * const *manpath); static char * const default_manpath[] = { @@ -1091,21 +1090,3 @@ tree = tree->wi_right; } } - -static void * -emalloc(size_t len) -{ - void *ptr; - if ((ptr = malloc(len)) == NULL) - err(EXIT_FAILURE, "malloc %lu failed", (unsigned long)len); - return ptr; -} - -static char * -estrdup(const char *str) -{ - char *ptr; - if ((ptr = strdup(str)) == NULL) - err(EXIT_FAILURE, "strdup failed"); - return ptr; -} Index: sbin/cgdconfig/params.c =================================================================== RCS file: /cvsroot/src/sbin/cgdconfig/params.c,v retrieving revision 1.15 diff -u -u -r1.15 params.c --- sbin/cgdconfig/params.c 17 Mar 2006 13:58:27 -0000 1.15 +++ sbin/cgdconfig/params.c 25 Aug 2006 17:11:14 -0000 @@ -49,6 +49,7 @@ #include #include #include +#include #include "params.h" #include "pkcs5_pbkdf2.h" Index: sbin/cgdconfig/pkcs5_pbkdf2.c =================================================================== RCS file: /cvsroot/src/sbin/cgdconfig/pkcs5_pbkdf2.c,v retrieving revision 1.8 diff -u -u -r1.8 pkcs5_pbkdf2.c --- sbin/cgdconfig/pkcs5_pbkdf2.c 11 May 2006 00:40:54 -0000 1.8 +++ sbin/cgdconfig/pkcs5_pbkdf2.c 25 Aug 2006 17:11:14 -0000 @@ -61,6 +61,8 @@ #include #include #include +#include +#include #include Index: sbin/cgdconfig/utils.c =================================================================== RCS file: /cvsroot/src/sbin/cgdconfig/utils.c,v retrieving revision 1.14 diff -u -u -r1.14 utils.c --- sbin/cgdconfig/utils.c 11 May 2006 00:42:08 -0000 1.14 +++ sbin/cgdconfig/utils.c 25 Aug 2006 17:11:14 -0000 @@ -46,6 +46,7 @@ #include #include #include +#include /* include the resolver gunk in order that we can use b64 routines */ #include @@ -55,33 +56,6 @@ #include "utils.h" -void * -emalloc(size_t len) -{ - void *ptr = malloc(len); - if (ptr == NULL) - err(1, NULL); - return ptr; -} - -void * -ecalloc(size_t nel, size_t len) -{ - void *ptr = calloc(nel, len); - if (ptr == NULL) - err(1, NULL); - return ptr; -} - -char * -estrdup(const char *str) -{ - char *ptr = strdup(str); - if (ptr == NULL) - err(1, NULL); - return ptr; -} - /* just strsep(3), but skips empty fields. */ static char * Index: sbin/cgdconfig/utils.h =================================================================== RCS file: /cvsroot/src/sbin/cgdconfig/utils.h,v retrieving revision 1.5 diff -u -u -r1.5 utils.h --- sbin/cgdconfig/utils.h 30 Mar 2005 17:10:18 -0000 1.5 +++ sbin/cgdconfig/utils.h 25 Aug 2006 17:11:14 -0000 @@ -50,9 +50,6 @@ typedef struct bits bits_t; __BEGIN_DECLS -void *emalloc(size_t); -void *ecalloc(size_t, size_t); -char *estrdup(const char *); char **words(const char *, int *); void words_free(char **, int); Index: sbin/fsck/Makefile =================================================================== RCS file: /cvsroot/src/sbin/fsck/Makefile,v retrieving revision 1.16 diff -u -u -r1.16 Makefile --- sbin/fsck/Makefile 19 Aug 2004 23:02:51 -0000 1.16 +++ sbin/fsck/Makefile 25 Aug 2006 17:11:14 -0000 @@ -4,4 +4,7 @@ SRCS= fsck.c fsutil.c preen.c MAN= fsck.8 +LDADD+=-lutil +DPADD+=${LIBUTIL} + .include Index: sbin/fsck/fsck.c =================================================================== RCS file: /cvsroot/src/sbin/fsck/fsck.c,v retrieving revision 1.42 diff -u -u -r1.42 fsck.c --- sbin/fsck/fsck.c 20 Mar 2006 01:27:44 -0000 1.42 +++ sbin/fsck/fsck.c 25 Aug 2006 17:11:14 -0000 @@ -59,6 +59,7 @@ #include #include #include +#include #include "pathnames.h" #include "fsutil.h" Index: sbin/fsck/fsutil.c =================================================================== RCS file: /cvsroot/src/sbin/fsck/fsutil.c,v retrieving revision 1.15 diff -u -u -r1.15 fsutil.c --- sbin/fsck/fsutil.c 5 Jun 2006 16:52:05 -0000 1.15 +++ sbin/fsck/fsutil.c 25 Aug 2006 17:11:15 -0000 @@ -242,39 +242,3 @@ */ return (origname); } - - -void * -emalloc(size_t s) -{ - void *p; - - p = malloc(s); - if (p == NULL) - err(1, "malloc failed"); - return (p); -} - - -void * -erealloc(void *p, size_t s) -{ - void *q; - - q = realloc(p, s); - if (q == NULL) - err(1, "realloc failed"); - return (q); -} - - -char * -estrdup(const char *s) -{ - char *p; - - p = strdup(s); - if (p == NULL) - err(1, "strdup failed"); - return (p); -} Index: sbin/fsck/fsutil.h =================================================================== RCS file: /cvsroot/src/sbin/fsck/fsutil.h,v retrieving revision 1.11 diff -u -u -r1.11 fsutil.h --- sbin/fsck/fsutil.h 5 Jun 2006 16:52:05 -0000 1.11 +++ sbin/fsck/fsutil.h 25 Aug 2006 17:11:15 -0000 @@ -49,9 +49,6 @@ const char *cdevname(void); void setcdevname(const char *, int); int hotroot(void); -void *emalloc(size_t); -void *erealloc(void *, size_t); -char *estrdup(const char *); #define CHECK_PREEN 1 #define CHECK_VERBOSE 2 Index: sbin/fsck/preen.c =================================================================== RCS file: /cvsroot/src/sbin/fsck/preen.c,v retrieving revision 1.27 diff -u -u -r1.27 preen.c --- sbin/fsck/preen.c 13 Jan 2005 22:56:09 -0000 1.27 +++ sbin/fsck/preen.c 25 Aug 2006 17:11:15 -0000 @@ -50,6 +50,7 @@ #include #include #include +#include #include "fsutil.h" Index: sbin/fsck_ext2fs/Makefile =================================================================== RCS file: /cvsroot/src/sbin/fsck_ext2fs/Makefile,v retrieving revision 1.12 diff -u -u -r1.12 Makefile --- sbin/fsck_ext2fs/Makefile 11 May 2006 23:16:29 -0000 1.12 +++ sbin/fsck_ext2fs/Makefile 25 Aug 2006 17:11:15 -0000 @@ -13,6 +13,9 @@ .include +LDADD+=-lutil +DPADD+=${LIBUTIL} + .if ${HAVE_GCC} == 4 .for f in pass5 utilities COPTS.${f}.c+= -Wno-pointer-sign Index: sbin/fsck_lfs/Makefile =================================================================== RCS file: /cvsroot/src/sbin/fsck_lfs/Makefile,v retrieving revision 1.13 diff -u -u -r1.13 Makefile --- sbin/fsck_lfs/Makefile 18 Jul 2006 23:37:13 -0000 1.13 +++ sbin/fsck_lfs/Makefile 25 Aug 2006 17:11:15 -0000 @@ -12,4 +12,7 @@ .PATH: ${NETBSDSRCDIR}/sys/ufs/lfs ${FSCK} CPPFLAGS+=-I${.CURDIR} -I${FSCK} -DIN_FSCK_LFS # -DVERBOSE_BLOCKMAP +LDADD+=-lutil +DPADD+=${LIBUTIL} + .include Index: sbin/fsck_msdos/Makefile =================================================================== RCS file: /cvsroot/src/sbin/fsck_msdos/Makefile,v retrieving revision 1.10 diff -u -u -r1.10 Makefile --- sbin/fsck_msdos/Makefile 20 Jan 2005 16:39:23 -0000 1.10 +++ sbin/fsck_msdos/Makefile 25 Aug 2006 17:11:15 -0000 @@ -10,4 +10,7 @@ CPPFLAGS+= -I${FSCK} .PATH: ${FSCK} +LDADD+=-lutil +DPADD+=${LIBUTIL} + .include Index: sbin/ifconfig/af_atalk.c =================================================================== RCS file: /cvsroot/src/sbin/ifconfig/af_atalk.c,v retrieving revision 1.3 diff -u -u -r1.3 af_atalk.c --- sbin/ifconfig/af_atalk.c 16 Jun 2006 23:48:35 -0000 1.3 +++ sbin/ifconfig/af_atalk.c 25 Aug 2006 17:11:15 -0000 @@ -49,6 +49,7 @@ #include #include #include +#include #include "extern.h" #include "af_atalk.h" Index: sbin/ifconfig/af_inet.c =================================================================== RCS file: /cvsroot/src/sbin/ifconfig/af_inet.c,v retrieving revision 1.3 diff -u -u -r1.3 af_inet.c --- sbin/ifconfig/af_inet.c 16 Jun 2006 23:48:35 -0000 1.3 +++ sbin/ifconfig/af_inet.c 25 Aug 2006 17:11:15 -0000 @@ -51,6 +51,7 @@ #include #include #include +#include #include "extern.h" #include "af_inet.h" Index: sbin/ifconfig/af_inet6.c =================================================================== RCS file: /cvsroot/src/sbin/ifconfig/af_inet6.c,v retrieving revision 1.4 diff -u -u -r1.4 af_inet6.c --- sbin/ifconfig/af_inet6.c 16 Jun 2006 23:48:35 -0000 1.4 +++ sbin/ifconfig/af_inet6.c 25 Aug 2006 17:11:15 -0000 @@ -50,6 +50,7 @@ #include #include #include +#include #include "extern.h" #include "af_inet6.h" Index: sbin/ifconfig/af_iso.c =================================================================== RCS file: /cvsroot/src/sbin/ifconfig/af_iso.c,v retrieving revision 1.3 diff -u -u -r1.3 af_iso.c --- sbin/ifconfig/af_iso.c 16 Jun 2006 23:48:35 -0000 1.3 +++ sbin/ifconfig/af_iso.c 25 Aug 2006 17:11:15 -0000 @@ -54,6 +54,7 @@ #include #include #include +#include #include "extern.h" #include "af_iso.h" Index: sbin/ifconfig/af_ns.c =================================================================== RCS file: /cvsroot/src/sbin/ifconfig/af_ns.c,v retrieving revision 1.4 diff -u -u -r1.4 af_ns.c --- sbin/ifconfig/af_ns.c 16 Jun 2006 23:48:35 -0000 1.4 +++ sbin/ifconfig/af_ns.c 25 Aug 2006 17:11:15 -0000 @@ -56,6 +56,7 @@ #include #include #include +#include #include "extern.h" #include "af_ns.h" Index: sbin/ifconfig/extern.h =================================================================== RCS file: /cvsroot/src/sbin/ifconfig/extern.h,v retrieving revision 1.9 diff -u -u -r1.9 extern.h --- sbin/ifconfig/extern.h 16 Jun 2006 23:48:35 -0000 1.9 +++ sbin/ifconfig/extern.h 25 Aug 2006 17:11:15 -0000 @@ -70,4 +70,3 @@ const char *get_string(const char *, const char *, u_int8_t *, int *); void print_string(const u_int8_t *, int); void getsock(int); -void estrlcpy(char *, char *, size_t); Index: sbin/ifconfig/ieee80211.c =================================================================== RCS file: /cvsroot/src/sbin/ifconfig/ieee80211.c,v retrieving revision 1.6 diff -u -u -r1.6 ieee80211.c --- sbin/ifconfig/ieee80211.c 16 Jun 2006 23:48:35 -0000 1.6 +++ sbin/ifconfig/ieee80211.c 25 Aug 2006 17:11:16 -0000 @@ -50,6 +50,7 @@ #include #include #include +#include #include "extern.h" #include "ieee80211.h" Index: sbin/ifconfig/ifconfig.c =================================================================== RCS file: /cvsroot/src/sbin/ifconfig/ifconfig.c,v retrieving revision 1.173 diff -u -u -r1.173 ifconfig.c --- sbin/ifconfig/ifconfig.c 13 Jul 2006 14:02:03 -0000 1.173 +++ sbin/ifconfig/ifconfig.c 25 Aug 2006 17:11:16 -0000 @@ -1574,12 +1574,3 @@ progname, progname, progname, progname, progname, progname); exit(1); } - -void -estrlcpy(char *dst, char *src, size_t len) -{ - if (strlcpy(dst, src, len) >= len) { - errno = ENAMETOOLONG; - err(1, "Cannot copy `%s'", src); - } -} Index: sbin/ifconfig/tunnel.c =================================================================== RCS file: /cvsroot/src/sbin/ifconfig/tunnel.c,v retrieving revision 1.6 diff -u -u -r1.6 tunnel.c --- sbin/ifconfig/tunnel.c 16 Jun 2006 23:48:35 -0000 1.6 +++ sbin/ifconfig/tunnel.c 25 Aug 2006 17:11:17 -0000 @@ -50,6 +50,7 @@ #include #include #include +#include #include "extern.h" #include "tunnel.h" Index: sbin/rcorder/Makefile =================================================================== RCS file: /cvsroot/src/sbin/rcorder/Makefile,v retrieving revision 1.5 diff -u -u -r1.5 Makefile --- sbin/rcorder/Makefile 27 Jun 2005 01:00:06 -0000 1.5 +++ sbin/rcorder/Makefile 25 Aug 2006 17:11:17 -0000 @@ -1,7 +1,10 @@ # $NetBSD: Makefile,v 1.5 2005/06/27 01:00:06 christos Exp $ PROG= rcorder -SRCS= ealloc.c hash.c rcorder.c +SRCS= hash.c rcorder.c MAN= rcorder.8 +LDADD+=-lutil +DPADD+=${LIBUTIL} + .include Index: sbin/rcorder/hash.c =================================================================== RCS file: /cvsroot/src/sbin/rcorder/hash.c,v retrieving revision 1.3 diff -u -u -r1.3 hash.c --- sbin/rcorder/hash.c 7 Aug 2003 10:04:37 -0000 1.3 +++ sbin/rcorder/hash.c 25 Aug 2006 17:11:17 -0000 @@ -87,6 +87,8 @@ #include #include #include +#include +#include /* hash.c -- * @@ -96,7 +98,6 @@ * information increases. */ #include "hash.h" -#include "ealloc.h" /* * Forward references to local procedures that are used before they're Index: sbin/rcorder/rcorder.c =================================================================== RCS file: /cvsroot/src/sbin/rcorder/rcorder.c,v retrieving revision 1.13 diff -u -u -r1.13 rcorder.c --- sbin/rcorder/rcorder.c 21 Sep 2004 15:47:32 -0000 1.13 +++ sbin/rcorder/rcorder.c 25 Aug 2006 17:11:17 -0000 @@ -66,8 +66,8 @@ #include #include #include +#include -#include "ealloc.h" #include "hash.h" #ifdef DEBUG Index: tools/compat/Makefile =================================================================== RCS file: /cvsroot/src/tools/compat/Makefile,v retrieving revision 1.43 diff -u -u -r1.43 Makefile --- tools/compat/Makefile 20 May 2006 00:23:39 -0000 1.43 +++ tools/compat/Makefile 25 Aug 2006 17:11:56 -0000 @@ -12,7 +12,7 @@ sha256hl.c sha384hl.c sha512hl.c snprintf.c \ strlcat.c strlcpy.c strmode.c strsep.c strsuftoll.c \ strtoll.c unvis.c vis.c err.c errx.c verr.c verrx.c \ - vwarn.c vwarnx.c warn.c warnx.c fts.c glob.c + vwarn.c vwarnx.c warn.c warnx.c fts.c glob.c efun.c BUILD_OSTYPE!= uname -s @@ -38,10 +38,11 @@ ${.CURDIR}/../../lib/libc/stdio \ ${.CURDIR}/../../lib/libc/stdlib \ ${.CURDIR}/../../lib/libc/string \ + ${.CURDIR}/../../lib/libutil \ ${.CURDIR}/../../common/lib/libc/string \ ${.CURDIR}/../../common/lib/libc/hash/sha1 \ ${.CURDIR}/../../common/lib/libc/md \ - ${.CURDIR}/../../usr.bin/lex \ + ${.CURDIR}/../../usr.bin/lex DPSRCS+= defs.mk CLEANFILES+= config.log config.status configure.lineno *.stamp Index: usr.bin/column/Makefile =================================================================== RCS file: /cvsroot/src/usr.bin/column/Makefile,v retrieving revision 1.5 diff -u -u -r1.5 Makefile --- usr.bin/column/Makefile 16 Mar 2006 16:49:07 -0000 1.5 +++ usr.bin/column/Makefile 25 Aug 2006 17:11:56 -0000 @@ -4,4 +4,7 @@ PROG= column WARNS= 4 +LDADD+=-lutil +DPADD+=${LIBUTIL} + .include Index: usr.bin/column/column.c =================================================================== RCS file: /cvsroot/src/usr.bin/column/column.c,v retrieving revision 1.14 diff -u -u -r1.14 column.c --- usr.bin/column/column.c 9 Apr 2006 19:51:23 -0000 1.14 +++ usr.bin/column/column.c 25 Aug 2006 17:11:57 -0000 @@ -53,13 +53,11 @@ #include #include #include +#include #define TAB 8 static void c_columnate(void); -static void *emalloc(size_t); -static void *erealloc(void *, size_t); -static char *estrdup(const char *); static void input(FILE *); static void maketbl(void); static void print(void); @@ -291,37 +289,6 @@ } } -static void * -emalloc(size_t size) -{ - void *p; - - if ((p = malloc(size)) == NULL) - err(1, "malloc"); - (void)memset(p, 0, size); - return (p); -} - -static void * -erealloc(void *op, size_t size) -{ - void *p; - - if ((p = realloc(op, size)) == NULL) - err(1, "realloc"); - return p; -} - -static char * -estrdup(const char *str) -{ - char *p; - - if ((p = strdup(str)) == NULL) - err(1, "strdup"); - return p; -} - static void usage(void) { Index: usr.bin/config/Makefile =================================================================== RCS file: /cvsroot/src/usr.bin/config/Makefile,v retrieving revision 1.3 diff -u -u -r1.3 Makefile --- usr.bin/config/Makefile 4 Jun 2006 19:42:19 -0000 1.3 +++ usr.bin/config/Makefile 25 Aug 2006 17:11:57 -0000 @@ -9,6 +9,9 @@ YHEADER=1 CPPFLAGS+=-I${.CURDIR} -I. +LDADD+=-lutil +DPADD+=${LIBUTIL} + CWARNFLAGS+=-Wno-format-y2k .include Index: usr.bin/config/files.c =================================================================== RCS file: /cvsroot/src/usr.bin/config/files.c,v retrieving revision 1.2 diff -u -u -r1.2 files.c --- usr.bin/config/files.c 7 Nov 2005 03:26:20 -0000 1.2 +++ usr.bin/config/files.c 25 Aug 2006 17:11:57 -0000 @@ -49,6 +49,7 @@ #include #include #include +#include #include "defs.h" extern const char *yyfile; Index: usr.bin/config/gram.y =================================================================== RCS file: /cvsroot/src/usr.bin/config/gram.y,v retrieving revision 1.7 diff -u -u -r1.7 gram.y --- usr.bin/config/gram.y 4 Jun 2006 13:07:24 -0000 1.7 +++ usr.bin/config/gram.y 25 Aug 2006 17:11:57 -0000 @@ -117,7 +117,7 @@ %token VERSION %token WITH %token NUMBER -%token PATHNAME QSTRING WORD EMPTY +%token PATHNAME QSTRING WORD EMPTYSTRING %token ENDDEFS %left '|' @@ -389,7 +389,7 @@ value: QSTRING { $$ = $1; } | WORD { $$ = $1; } | - EMPTY { $$ = $1; } | + EMPTYSTRING { $$ = $1; } | signed_number { char bf[40]; (void)snprintf(bf, sizeof(bf), FORMAT($1), (long long)$1.val); Index: usr.bin/config/hash.c =================================================================== RCS file: /cvsroot/src/usr.bin/config/hash.c,v retrieving revision 1.1 diff -u -u -r1.1 hash.c --- usr.bin/config/hash.c 5 Jun 2005 18:19:53 -0000 1.1 +++ usr.bin/config/hash.c 25 Aug 2006 17:11:57 -0000 @@ -47,6 +47,7 @@ #include #include #include +#include #include "defs.h" /* Index: usr.bin/config/main.c =================================================================== RCS file: /cvsroot/src/usr.bin/config/main.c,v retrieving revision 1.13 diff -u -u -r1.13 main.c --- usr.bin/config/main.c 25 May 2006 22:28:38 -0000 1.13 +++ usr.bin/config/main.c 25 Aug 2006 17:11:58 -0000 @@ -68,9 +68,11 @@ #include #include #include +#include +#include + #include "defs.h" #include "sem.h" -#include #ifndef LINE_MAX #define LINE_MAX 1024 Index: usr.bin/config/mkheaders.c =================================================================== RCS file: /cvsroot/src/usr.bin/config/mkheaders.c,v retrieving revision 1.5 diff -u -u -r1.5 mkheaders.c --- usr.bin/config/mkheaders.c 25 May 2006 22:28:38 -0000 1.5 +++ usr.bin/config/mkheaders.c 25 Aug 2006 17:11:59 -0000 @@ -51,6 +51,7 @@ #include #include #include +#include #include "defs.h" static int emitcnt(struct nvlist *); Index: usr.bin/config/pack.c =================================================================== RCS file: /cvsroot/src/usr.bin/config/pack.c,v retrieving revision 1.3 diff -u -u -r1.3 pack.c --- usr.bin/config/pack.c 1 Oct 2005 23:30:37 -0000 1.3 +++ usr.bin/config/pack.c 25 Aug 2006 17:11:59 -0000 @@ -47,6 +47,7 @@ #include #include #include +#include #include "defs.h" /* Index: usr.bin/config/scan.l =================================================================== RCS file: /cvsroot/src/usr.bin/config/scan.l,v retrieving revision 1.4 diff -u -u -r1.4 scan.l --- usr.bin/config/scan.l 25 May 2006 22:28:38 -0000 1.4 +++ usr.bin/config/scan.l 25 Aug 2006 17:11:59 -0000 @@ -50,6 +50,8 @@ #include #include #include +#include +#undef ECHO #include "defs.h" #include "gram.h" @@ -169,7 +171,7 @@ \"\" { yylval.str = intern(""); - return EMPTY; + return EMPTYSTRING; } \"{QCHARS} { Index: usr.bin/config/sem.c =================================================================== RCS file: /cvsroot/src/usr.bin/config/sem.c,v retrieving revision 1.23 diff -u -u -r1.23 sem.c --- usr.bin/config/sem.c 7 Aug 2006 12:03:32 -0000 1.23 +++ usr.bin/config/sem.c 25 Aug 2006 17:11:59 -0000 @@ -49,6 +49,7 @@ #include #include #include +#include #include "defs.h" #include "sem.h" Index: usr.bin/config/util.c =================================================================== RCS file: /cvsroot/src/usr.bin/config/util.c,v retrieving revision 1.2 diff -u -u -r1.2 util.c --- usr.bin/config/util.c 4 Oct 2005 12:35:00 -0000 1.2 +++ usr.bin/config/util.c 25 Aug 2006 17:11:59 -0000 @@ -44,12 +44,13 @@ #include "nbtool_config.h" #endif +#include #include #include #include #include #include -#include +#include #include "defs.h" static void nomem(void); Index: usr.bin/crunch/crunchgen/Makefile =================================================================== RCS file: /cvsroot/src/usr.bin/crunch/crunchgen/Makefile,v retrieving revision 1.13 diff -u -u -r1.13 Makefile --- usr.bin/crunch/crunchgen/Makefile 3 Jan 2004 14:04:27 -0000 1.13 +++ usr.bin/crunch/crunchgen/Makefile 25 Aug 2006 17:11:59 -0000 @@ -8,6 +8,10 @@ ${_MKTARGET_CREATE} ${HOST_SH} ${.ALLSRC} >${.TARGET} + +LDADD+=-lutil +DPADD+=${LIBUTIL} + .include .ifndef HOSTPROG Index: usr.bin/crunch/crunchgen/crunchgen.c =================================================================== RCS file: /cvsroot/src/usr.bin/crunch/crunchgen/crunchgen.c,v retrieving revision 1.71 diff -u -u -r1.71 crunchgen.c --- usr.bin/crunch/crunchgen/crunchgen.c 13 Jun 2006 17:18:56 -0000 1.71 +++ usr.bin/crunch/crunchgen/crunchgen.c 25 Aug 2006 17:12:00 -0000 @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -115,8 +116,6 @@ void add_string(strlst_t **listp, char *str); int is_dir(char *pathname); int is_nonempty_file(char *pathname); -static void estrlcpy(char *, const char *, size_t); -static void estrlcat(char *, const char *, size_t); /* helper routines for main() */ @@ -164,13 +163,13 @@ case 'O': oneobj = 0; break; case 'o': useobjs = 1, oneobj = 0; break; - case 'm': estrlcpy(outmkname, optarg, sizeof(outmkname)); break; - case 'c': estrlcpy(outcfname, optarg, sizeof(outcfname)); break; - case 'e': estrlcpy(execfname, optarg, sizeof(execfname)); break; - case 'd': estrlcpy(dbg, optarg, sizeof(dbg)); break; + case 'm': (void)estrlcpy(outmkname, optarg, sizeof(outmkname)); break; + case 'c': (void)estrlcpy(outcfname, optarg, sizeof(outcfname)); break; + case 'e': (void)estrlcpy(execfname, optarg, sizeof(execfname)); break; + case 'd': (void)estrlcpy(dbg, optarg, sizeof(dbg)); break; - case 'D': estrlcpy(topdir, optarg, sizeof(topdir)); break; - case 'L': estrlcpy(libdir, optarg, sizeof(libdir)); break; + case 'D': (void)estrlcpy(topdir, optarg, sizeof(topdir)); break; + case 'L': (void)estrlcpy(libdir, optarg, sizeof(libdir)); break; case 'v': add_string(&vars, optarg); break; case '?': @@ -188,15 +187,15 @@ * generate filenames */ - estrlcpy(infilename, argv[0], sizeof(infilename)); + (void)estrlcpy(infilename, argv[0], sizeof(infilename)); getcwd(curdir, MAXPATHLEN); /* confname = `basename infilename .conf` */ if ((p = strrchr(infilename, '/')) != NULL) - estrlcpy(confname, p + 1, sizeof(confname)); + (void)estrlcpy(confname, p + 1, sizeof(confname)); else - estrlcpy(confname, infilename, sizeof(confname)); + (void)estrlcpy(confname, infilename, sizeof(confname)); if ((p = strrchr(confname, '.')) != NULL && !strcmp(p, ".conf")) *p = '\0'; @@ -273,7 +272,7 @@ (void)snprintf(line, sizeof(line), "reading %s", filename); status(line); - estrlcpy(curfilename, filename, sizeof(curfilename)); + (void)estrlcpy(curfilename, filename, sizeof(curfilename)); if ((cf = fopen(curfilename, "r")) == NULL) { perror(curfilename); @@ -350,14 +349,14 @@ for (i = 1; i < argc; i++) { if (argv[i][0] == '/') - estrlcpy(tmppath, argv[i], sizeof(tmppath)); + (void)estrlcpy(tmppath, argv[i], sizeof(tmppath)); else { if (topdir[0] == '\0') - estrlcpy(tmppath, curdir, sizeof(tmppath)); + (void)estrlcpy(tmppath, curdir, sizeof(tmppath)); else - estrlcpy(tmppath, topdir, sizeof(tmppath)); - estrlcat(tmppath, "/", sizeof(tmppath)); - estrlcat(tmppath, argv[i], sizeof(tmppath)); + (void)estrlcpy(tmppath, topdir, sizeof(tmppath)); + (void)estrlcat(tmppath, "/", sizeof(tmppath)); + (void)estrlcat(tmppath, argv[i], sizeof(tmppath)); } if (is_dir(tmppath)) add_string(&srcdirs, tmppath); @@ -470,11 +469,11 @@ } else { char tmppath[MAXPATHLEN]; if (topdir[0] == '\0') - estrlcpy(tmppath, curdir, sizeof(tmppath)); + (void)estrlcpy(tmppath, curdir, sizeof(tmppath)); else - estrlcpy(tmppath, topdir, sizeof(tmppath)); - estrlcat(tmppath, "/", sizeof(tmppath)); - estrlcat(tmppath, argv[3], sizeof(tmppath)); + (void)estrlcpy(tmppath, topdir, sizeof(tmppath)); + (void)estrlcat(tmppath, "/", sizeof(tmppath)); + (void)estrlcat(tmppath, argv[3], sizeof(tmppath)); if ((p->srcdir = strdup(tmppath)) == NULL) out_of_memory(); } @@ -603,11 +602,11 @@ } else { char tmppath[MAXPATHLEN]; if (topdir[0] == '\0') - estrlcpy(tmppath, curdir, sizeof(tmppath)); + (void)estrlcpy(tmppath, curdir, sizeof(tmppath)); else - estrlcpy(tmppath, topdir, sizeof(tmppath)); - estrlcat(tmppath, "/", sizeof(tmppath)); - estrlcat(tmppath, path, sizeof(tmppath)); + (void)estrlcpy(tmppath, topdir, sizeof(tmppath)); + (void)estrlcat(tmppath, "/", sizeof(tmppath)); + (void)estrlcat(tmppath, path, sizeof(tmppath)); if ((p->srcdir = strdup(tmppath)) == NULL) out_of_memory(); } @@ -1146,21 +1145,3 @@ return S_ISREG(buf.st_mode) && buf.st_size > 0; } - -static void -estrlcpy(char *dst, const char *src, size_t len) -{ - if (strlcpy(dst, src, len) >= len) { - errno = ENAMETOOLONG; - err(1, "Cannot copy `%s'", src); - } -} - -static void -estrlcat(char *dst, const char *src, size_t len) -{ - if (strlcat(dst, src, len) >= len) { - errno = ENAMETOOLONG; - err(1, "Cannot append `%s'", src); - } -} Index: usr.bin/find/Makefile =================================================================== RCS file: /cvsroot/src/usr.bin/find/Makefile,v retrieving revision 1.9 diff -u -u -r1.9 Makefile --- usr.bin/find/Makefile 18 Sep 2002 14:00:36 -0000 1.9 +++ usr.bin/find/Makefile 25 Aug 2006 17:12:00 -0000 @@ -9,4 +9,7 @@ CPPFLAGS+= -I${NETBSDSRCDIR}/bin/ls .PATH: ${NETBSDSRCDIR}/bin/ls +LDADD+=-lutil +DPADD+=${LIBUTIL} + .include Index: usr.bin/find/extern.h =================================================================== RCS file: /cvsroot/src/usr.bin/find/extern.h,v retrieving revision 1.23 diff -u -u -r1.23 extern.h --- usr.bin/find/extern.h 20 Feb 2006 16:31:02 -0000 1.23 +++ usr.bin/find/extern.h 25 Aug 2006 17:12:00 -0000 @@ -34,7 +34,6 @@ #include void brace_subst __P((char *, char **, char *, int *)); -void *emalloc __P((unsigned int)); PLAN *find_create __P((char ***)); int find_execute __P((PLAN *, char **)); PLAN *find_formplan __P((char **)); Index: usr.bin/find/function.c =================================================================== RCS file: /cvsroot/src/usr.bin/find/function.c,v retrieving revision 1.54 diff -u -u -r1.54 function.c --- usr.bin/find/function.c 10 May 2006 21:53:20 -0000 1.54 +++ usr.bin/find/function.c 25 Aug 2006 17:12:01 -0000 @@ -59,6 +59,7 @@ #include #include #include +#include #include "find.h" #include "stat_flags.h" Index: usr.bin/find/misc.c =================================================================== RCS file: /cvsroot/src/usr.bin/find/misc.c,v retrieving revision 1.12 diff -u -u -r1.12 misc.c --- usr.bin/find/misc.c 7 Aug 2003 11:13:42 -0000 1.12 +++ usr.bin/find/misc.c 25 Aug 2006 17:12:01 -0000 @@ -128,21 +128,6 @@ } /* - * emalloc -- - * malloc with error checking. - */ -void * -emalloc(len) - u_int len; -{ - void *p; - - if ((p = malloc(len)) == NULL) - err(1, "malloc"); - return (p); -} - -/* * show_path -- * called on SIGINFO */ Index: usr.bin/hexdump/Makefile =================================================================== RCS file: /cvsroot/src/usr.bin/hexdump/Makefile,v retrieving revision 1.9 diff -u -u -r1.9 Makefile --- usr.bin/hexdump/Makefile 18 May 2003 07:57:34 -0000 1.9 +++ usr.bin/hexdump/Makefile 25 Aug 2006 17:12:01 -0000 @@ -7,6 +7,9 @@ WFORMAT= 1 WARNS= 2 +LDADD+=-lutil +DPADD+=${LIBUTIL} + .ifndef HOSTPROG LINKS= ${BINDIR}/hexdump ${BINDIR}/od .endif Index: usr.bin/hexdump/display.c =================================================================== RCS file: /cvsroot/src/usr.bin/hexdump/display.c,v retrieving revision 1.19 diff -u -u -r1.19 display.c --- usr.bin/hexdump/display.c 4 Jan 2006 01:30:21 -0000 1.19 +++ usr.bin/hexdump/display.c 25 Aug 2006 17:12:01 -0000 @@ -53,6 +53,7 @@ #include #include #include +#include #include "hexdump.h" @@ -238,8 +239,8 @@ u_char *tmpp; if (!curp) { - curp = emalloc(blocksize); - savp = emalloc(blocksize); + curp = ecalloc(blocksize, 1); + savp = ecalloc(blocksize, 1); } else { tmpp = curp; curp = savp; @@ -357,20 +358,3 @@ skip -= cnt; } } - -void * -emalloc(int allocsize) -{ - void *p; - - if ((p = malloc((u_int)allocsize)) == NULL) - nomem(); - memset(p, 0, allocsize); - return(p); -} - -void -nomem(void) -{ - err(1, NULL); -} Index: usr.bin/hexdump/hexdump.h =================================================================== RCS file: /cvsroot/src/usr.bin/hexdump/hexdump.h,v retrieving revision 1.9 diff -u -u -r1.9 hexdump.h --- usr.bin/hexdump/hexdump.h 4 Jan 2006 01:30:21 -0000 1.9 +++ usr.bin/hexdump/hexdump.h 25 Aug 2006 17:12:01 -0000 @@ -91,12 +91,10 @@ void display(void); void doskip(const char *, int); /*void err(const char *, ...);*/ -void *emalloc(int); void escape(char *); u_char *get(void); void newsyntax(int, char ***); int next(char **); -void nomem(void); void oldsyntax(int, char ***); void rewrite(FS *); int size(FS *); Index: usr.bin/hexdump/odsyntax.c =================================================================== RCS file: /cvsroot/src/usr.bin/hexdump/odsyntax.c,v retrieving revision 1.23 diff -u -u -r1.23 odsyntax.c --- usr.bin/hexdump/odsyntax.c 4 Jan 2006 01:30:21 -0000 1.23 +++ usr.bin/hexdump/odsyntax.c 25 Aug 2006 17:12:01 -0000 @@ -49,6 +49,7 @@ #include #include #include +#include #include "hexdump.h" @@ -284,10 +285,9 @@ break; if (odf->type == 0) errx(1, "%c%d: format not supported", type, nbytes); - asprintf(&fmt, "%d/%d \"%*s%s \" \"\\n\"", + (void)easprintf(&fmt, "%d/%d \"%*s%s \" \"\\n\"", 16 / nbytes, nbytes, 4 * nbytes - odf->minwidth, "", odf->format); - if (fmt == NULL) nomem(); add(fmt); } } Index: usr.bin/hexdump/parse.c =================================================================== RCS file: /cvsroot/src/usr.bin/hexdump/parse.c,v retrieving revision 1.19 diff -u -u -r1.19 parse.c --- usr.bin/hexdump/parse.c 30 Mar 2006 19:53:58 -0000 1.19 +++ usr.bin/hexdump/parse.c 25 Aug 2006 17:12:02 -0000 @@ -52,6 +52,7 @@ #include #include #include +#include #include "hexdump.h" @@ -145,8 +146,7 @@ for (savep = ++p; *p != '"';) if (*p++ == 0) badfmt(fmt); - if (!(tfu->fmt = malloc(p - savep + 1))) - nomem(); + tfu->fmt = emalloc(p - savep + 1); (void) strncpy(tfu->fmt, savep, p - savep); tfu->fmt[p - savep] = '\0'; escape(tfu->fmt); Index: usr.bin/iconv/Makefile =================================================================== RCS file: /cvsroot/src/usr.bin/iconv/Makefile,v retrieving revision 1.4 diff -u -u -r1.4 Makefile --- usr.bin/iconv/Makefile 24 Apr 2005 17:46:06 -0000 1.4 +++ usr.bin/iconv/Makefile 25 Aug 2006 17:12:02 -0000 @@ -8,4 +8,7 @@ CPPFLAGS+= -I. -I${.CURDIR} -I${NETBSDSRCDIR}/lib/libc MAN= iconv.1 +LDADD+=-lutil +DPADD+=${LIBUTIL} + .include Index: usr.bin/iconv/iconv.c =================================================================== RCS file: /cvsroot/src/usr.bin/iconv/iconv.c,v retrieving revision 1.9 diff -u -u -r1.9 iconv.c --- usr.bin/iconv/iconv.c 25 Apr 2005 13:57:34 -0000 1.9 +++ usr.bin/iconv/iconv.c 25 Aug 2006 17:12:02 -0000 @@ -38,9 +38,9 @@ #include #include #include +#include static void usage(void) __attribute__((__unused__)); -static char *estrdup(const char *); static int scmp(const void *, const void *); static void show_codesets(void); static void do_conv(const char *, FILE *, const char *, const char *, int, int); @@ -53,15 +53,6 @@ exit(1); } -static char * -estrdup(const char *str) -{ - char *ptr = strdup(str); - if (ptr == NULL) - err(EXIT_FAILURE, "Cannot copy string"); - return ptr; -} - /* * qsort() helper function */ Index: usr.bin/make/Makefile =================================================================== RCS file: /cvsroot/src/usr.bin/make/Makefile,v retrieving revision 1.36 diff -u -u -r1.36 Makefile --- usr.bin/make/Makefile 15 Jun 2006 10:55:02 -0000 1.36 +++ usr.bin/make/Makefile 25 Aug 2006 17:12:02 -0000 @@ -31,6 +31,9 @@ main.o: ${OBJS:Nmain.o} ${MAKEFILE} COPTS.var.c+= -Wno-cast-qual +LDADD+=-lutil +DPADD+=${LIBUTIL} + # A simple unit-test driver to help catch regressions accept test: cd ${.CURDIR}/unit-tests && ${.MAKE:S,^./,${.CURDIR}/,} TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET} Index: usr.bin/make/main.c =================================================================== RCS file: /cvsroot/src/usr.bin/make/main.c,v retrieving revision 1.128 diff -u -u -r1.128 main.c --- usr.bin/make/main.c 28 Jul 2006 17:06:14 -0000 1.128 +++ usr.bin/make/main.c 25 Aug 2006 17:12:03 -0000 @@ -1341,13 +1341,13 @@ * * Results: * A string containing the output of the command, or the empty string - * If err is not NULL, it contains the reason for the command failure + * If errnum is not NULL, it contains the reason for the command failure * * Side Effects: * The string must be freed by the caller. */ char * -Cmd_Exec(const char *cmd, const char **err) +Cmd_Exec(const char *cmd, const char **errnum) { const char *args[4]; /* Args for invoking the shell */ int fds[2]; /* Pipe streams */ @@ -1360,7 +1360,7 @@ int cc; - *err = NULL; + *errnum = NULL; if (!shellName) Shell_Init(); @@ -1376,7 +1376,7 @@ * Open a pipe for fetching its output */ if (pipe(fds) == -1) { - *err = "Couldn't create pipe for \"%s\""; + *errnum = "Couldn't create pipe for \"%s\""; goto bad; } @@ -1403,7 +1403,7 @@ /*NOTREACHED*/ case -1: - *err = "Couldn't exec \"%s\""; + *errnum = "Couldn't exec \"%s\""; goto bad; default: @@ -1437,10 +1437,10 @@ Buf_Destroy(buf, FALSE); if (cc == 0) - *err = "Couldn't read shell's output for \"%s\""; + *errnum = "Couldn't read shell's output for \"%s\""; if (status) - *err = "\"%s\" returned non-zero status"; + *errnum = "\"%s\" returned non-zero status"; /* * Null-terminate the result, convert newlines to spaces and @@ -1596,6 +1596,7 @@ Fatal("%d error%s", errors, errors == 1 ? "" : "s"); } +#ifndef __NetBSD__ /* * emalloc -- * malloc, but die on error. @@ -1646,6 +1647,7 @@ (void)fprintf(stderr, "%s: %s.\n", progname, strerror(errno)); exit(2); } +#endif /* * enunlink -- Index: usr.bin/make/make.h =================================================================== RCS file: /cvsroot/src/usr.bin/make/make.h,v retrieving revision 1.59 diff -u -u -r1.59 make.h --- usr.bin/make/make.h 10 Mar 2006 15:53:55 -0000 1.59 +++ usr.bin/make/make.h 25 Aug 2006 17:12:03 -0000 @@ -88,6 +88,7 @@ #include #include #include +#include #ifdef BSD4_4 # include Index: usr.bin/make/nonints.h =================================================================== RCS file: /cvsroot/src/usr.bin/make/nonints.h,v retrieving revision 1.36 diff -u -u -r1.36 nonints.h --- usr.bin/make/nonints.h 31 Mar 2006 21:58:08 -0000 1.36 +++ usr.bin/make/nonints.h 25 Aug 2006 17:12:03 -0000 @@ -115,10 +115,14 @@ void DieHorribly(void) __attribute__((__noreturn__)); int PrintAddr(ClientData, ClientData); void Finish(int); +#ifndef __NetBSD__ char *estrdup(const char *); void *emalloc(size_t); void *erealloc(void *, size_t); void enomem(void); +#else +#include +#endif int eunlink(const char *); void execError(const char *, const char *); Index: usr.bin/make/parse.c =================================================================== RCS file: /cvsroot/src/usr.bin/make/parse.c,v retrieving revision 1.114 diff -u -u -r1.114 parse.c --- usr.bin/make/parse.c 31 Mar 2006 21:58:08 -0000 1.114 +++ usr.bin/make/parse.c 25 Aug 2006 17:12:05 -0000 @@ -1206,17 +1206,17 @@ * allow on this line... */ if (specType != Not && specType != ExPath) { - Boolean warn = FALSE; + Boolean warning = FALSE; while (*cp && (ParseIsEscaped(lstart, cp) || ((*cp != '!') && (*cp != ':')))) { if (ParseIsEscaped(lstart, cp) || (*cp != ' ' && *cp != '\t')) { - warn = TRUE; + warning = TRUE; } cp++; } - if (warn) { + if (warning) { Parse_Error(PARSE_WARNING, "Extra target ignored"); } } else { @@ -1734,7 +1734,7 @@ Var_Set(line, cp, ctxt, 0); } else if (type == VAR_SHELL) { char *res; - const char *err; + const char *error; if (strchr(cp, '$') != NULL) { /* @@ -1746,12 +1746,12 @@ freeCp = TRUE; } - res = Cmd_Exec(cp, &err); + res = Cmd_Exec(cp, &error); Var_Set(line, res, ctxt, 0); free(res); - if (err) - Parse_Error(PARSE_WARNING, err, cp); + if (error) + Parse_Error(PARSE_WARNING, error, cp); } else { /* * Normal assignment -- just do it. Index: usr.bin/make/var.c =================================================================== RCS file: /cvsroot/src/usr.bin/make/var.c,v retrieving revision 1.112 diff -u -u -r1.112 var.c --- usr.bin/make/var.c 28 Jul 2006 17:08:55 -0000 1.112 +++ usr.bin/make/var.c 25 Aug 2006 17:12:06 -0000 @@ -144,7 +144,7 @@ char var_Error[] = ""; /* - * Similar to var_Error, but returned when the 'err' flag for Var_Parse is + * Similar to var_Error, but returned when the 'errnum' flag for Var_Parse is * set false. Why not just use a constant? Well, gcc likes to condense * identical string instances... */ @@ -232,7 +232,7 @@ int tvarLen; char *str; /* string to expand */ int strLen; - int err; /* err for not defined */ + int errnum; /* errnum for not defined */ } VarLoop_t; #ifndef NO_REGEX @@ -1219,14 +1219,14 @@ *----------------------------------------------------------------------- */ static void -VarREError(int err, regex_t *pat, const char *str) +VarREError(int errnum, regex_t *pat, const char *str) { char *errbuf; int errlen; - errlen = regerror(err, pat, 0, 0); + errlen = regerror(errnum, pat, 0, 0); errbuf = emalloc(errlen); - regerror(err, pat, errbuf, errlen); + regerror(errnum, pat, errbuf, errlen); Error("%s: %s", str, errbuf); free(errbuf); } @@ -1397,7 +1397,7 @@ if (word && *word) { Var_Set(loop->tvar, word, loop->ctxt, VAR_NO_EXPORT); - s = Var_Subst(NULL, loop->str, loop->ctxt, loop->err); + s = Var_Subst(NULL, loop->str, loop->ctxt, loop->errnum); if (s != NULL && *s != '\0') { if (addSpace && *s != '\n') Buf_AddByte(buf, ' '); @@ -1716,7 +1716,7 @@ */ static char * VarGetPattern(GNode *ctxt, Var_Parse_State *vpstate __unused, - int err, const char **tstr, int delim, int *flags, + int errnum, const char **tstr, int delim, int *flags, int *length, VarPattern *pattern) { const char *cp; @@ -1760,7 +1760,7 @@ * delimiter, assume it's a variable * substitution and recurse. */ - cp2 = Var_Parse(cp, ctxt, err, &len, &freeIt); + cp2 = Var_Parse(cp, ctxt, errnum, &len, &freeIt); Buf_AddBytes(buf, strlen(cp2), (Byte *)cp2); if (freeIt) free(freeIt); @@ -1978,7 +1978,7 @@ static char * ApplyModifiers(char *nstr, const char *tstr, int startc, int endc, - Var *v, GNode *ctxt, Boolean err, + Var *v, GNode *ctxt, Boolean errnum, int *lengthPtr, void **freePtr) { const char *start; @@ -2008,7 +2008,7 @@ char *rval; int rlen; - rval = Var_Parse(tstr, ctxt, err, &rlen, &freeIt); + rval = Var_Parse(tstr, ctxt, errnum, &rlen, &freeIt); if (DEBUG(VAR)) { printf("Got '%s' from '%.*s'%.*s\n", @@ -2022,9 +2022,9 @@ nstr = ApplyModifiers(nstr, rval, 0, 0, - v, ctxt, err, &used, freePtr); + v, ctxt, errnum, &used, freePtr); if (nstr == var_Error - || (nstr == varNoError && err == 0) + || (nstr == varNoError && errnum == 0) || strlen(rval) != (size_t) used) { if (freeIt) free(freeIt); @@ -2087,7 +2087,7 @@ delim = BRCLOSE; pattern.flags = 0; - pattern.rhs = VarGetPattern(ctxt, &parsestate, err, + pattern.rhs = VarGetPattern(ctxt, &parsestate, errnum, &cp, delim, NULL, &pattern.rightLen, NULL); @@ -2136,13 +2136,13 @@ cp = ++tstr; delim = '@'; - if ((loop.tvar = VarGetPattern(ctxt, &parsestate, err, + if ((loop.tvar = VarGetPattern(ctxt, &parsestate, errnum, &cp, delim, &flags, &loop.tvarLen, NULL)) == NULL) goto cleanup; - if ((loop.str = VarGetPattern(ctxt, &parsestate, err, + if ((loop.str = VarGetPattern(ctxt, &parsestate, errnum, &cp, delim, &flags, &loop.strLen, NULL)) == NULL) @@ -2151,7 +2151,7 @@ termc = *cp; delim = '\0'; - loop.err = err; + loop.errnum = errnum; loop.ctxt = ctxt; newStr = VarModify(ctxt, &parsestate, nstr, VarLoopExpand, (ClientData)&loop); @@ -2193,7 +2193,7 @@ int len; void *freeIt; - cp2 = Var_Parse(cp, ctxt, err, &len, &freeIt); + cp2 = Var_Parse(cp, ctxt, errnum, &len, &freeIt); Buf_AddBytes(buf, strlen(cp2), (Byte *)cp2); if (freeIt) free(freeIt); @@ -2260,7 +2260,7 @@ delim = '!'; cp = ++tstr; - if ((pattern.rhs = VarGetPattern(ctxt, &parsestate, err, + if ((pattern.rhs = VarGetPattern(ctxt, &parsestate, errnum, &cp, delim, NULL, &pattern.rightLen, NULL)) == NULL) @@ -2290,7 +2290,7 @@ cp = tstr+1; /* point to char after '[' */ delim = ']'; /* look for closing ']' */ estr = VarGetPattern(ctxt, &parsestate, - err, &cp, delim, + errnum, &cp, delim, NULL, NULL, NULL); if (estr == NULL) goto cleanup; /* report missing ']' */ @@ -2581,7 +2581,7 @@ } if ((cp2 = strchr(pattern, '$'))) { cp2 = pattern; - pattern = Var_Subst(NULL, cp2, ctxt, err); + pattern = Var_Subst(NULL, cp2, ctxt, errnum); if (copy) free(cp2); copy = TRUE; @@ -2618,14 +2618,14 @@ } cp = tstr; - if ((pattern.lhs = VarGetPattern(ctxt, &parsestate, err, + if ((pattern.lhs = VarGetPattern(ctxt, &parsestate, errnum, &cp, delim, &pattern.flags, &pattern.leftLen, NULL)) == NULL) goto cleanup; - if ((pattern.rhs = VarGetPattern(ctxt, &parsestate, err, + if ((pattern.rhs = VarGetPattern(ctxt, &parsestate, errnum, &cp, delim, NULL, &pattern.rightLen, &pattern)) == NULL) @@ -2675,7 +2675,7 @@ cp = ++tstr; delim = ':'; - if ((pattern.lhs = VarGetPattern(ctxt, &parsestate, err, + if ((pattern.lhs = VarGetPattern(ctxt, &parsestate, errnum, &cp, delim, NULL, &pattern.leftLen, NULL)) == NULL) @@ -2683,7 +2683,7 @@ /* BROPEN or PROPEN */ delim = endc; - if ((pattern.rhs = VarGetPattern(ctxt, &parsestate, err, + if ((pattern.rhs = VarGetPattern(ctxt, &parsestate, errnum, &cp, delim, NULL, &pattern.rightLen, NULL)) == NULL) @@ -2725,12 +2725,12 @@ cp = tstr; - if ((re = VarGetPattern(ctxt, &parsestate, err, &cp, delim, + if ((re = VarGetPattern(ctxt, &parsestate, errnum, &cp, delim, NULL, NULL, NULL)) == NULL) goto cleanup; if ((pattern.replace = VarGetPattern(ctxt, &parsestate, - err, &cp, delim, NULL, + errnum, &cp, delim, NULL, NULL, NULL)) == NULL){ free(re); goto cleanup; @@ -2904,12 +2904,12 @@ delim='='; cp = tstr; if ((pattern.lhs = VarGetPattern(ctxt, &parsestate, - err, &cp, delim, &pattern.flags, + errnum, &cp, delim, &pattern.flags, &pattern.leftLen, NULL)) == NULL) goto cleanup; delim = endc; if ((pattern.rhs = VarGetPattern(ctxt, &parsestate, - err, &cp, delim, NULL, &pattern.rightLen, + errnum, &cp, delim, NULL, &pattern.rightLen, &pattern)) == NULL) goto cleanup; @@ -2992,7 +2992,7 @@ * Input: * str The string to parse * ctxt The context for the variable - * err TRUE if undefined variables are an error + * errnum TRUE if undefined variables are an error * lengthPtr OUT: The length of the specification * freePtr OUT: TRUE if caller should free result * @@ -3011,7 +3011,7 @@ */ /* coverity[+alloc : arg-*4] */ char * -Var_Parse(const char *str, GNode *ctxt, Boolean err, int *lengthPtr, +Var_Parse(const char *str, GNode *ctxt, Boolean errnum, int *lengthPtr, void **freePtr) { const char *tstr; /* Pointer into str */ @@ -3075,7 +3075,7 @@ /* * Error */ - return (err ? var_Error : varNoError); + return (errnum ? var_Error : varNoError); } else { haveModifier = FALSE; tstr = &str[1]; @@ -3083,7 +3083,7 @@ } } else if (str[1] == '\0') { *lengthPtr = 1; - return (err ? var_Error : varNoError); + return (errnum ? var_Error : varNoError); } else { Buffer buf; /* Holds the variable name */ @@ -3104,7 +3104,7 @@ if (*tstr == '$') { int rlen; void *freeIt; - char *rval = Var_Parse(tstr, ctxt, err, &rlen, &freeIt); + char *rval = Var_Parse(tstr, ctxt, errnum, &rlen, &freeIt); if (rval != NULL) { Buf_AddBytes(buf, strlen(rval), (Byte *)rval); } @@ -3246,7 +3246,7 @@ return(pstr); } else { Buf_Destroy(buf, TRUE); - return (err ? var_Error : varNoError); + return (errnum ? var_Error : varNoError); } } else { /* @@ -3281,7 +3281,7 @@ */ nstr = (char *)Buf_GetAll(v->val, NULL); if (strchr(nstr, '$') != NULL) { - nstr = Var_Subst(NULL, nstr, ctxt, err); + nstr = Var_Subst(NULL, nstr, ctxt, errnum); *freePtr = nstr; } @@ -3296,7 +3296,7 @@ tstr++; nstr = ApplyModifiers(nstr, tstr, startc, endc, - v, ctxt, err, &used, freePtr); + v, ctxt, errnum, &used, freePtr); tstr += used; *lengthPtr = tstr - start + 1; } else { Index: usr.bin/shuffle/Makefile =================================================================== RCS file: /cvsroot/src/usr.bin/shuffle/Makefile,v retrieving revision 1.1 diff -u -u -r1.1 Makefile --- usr.bin/shuffle/Makefile 23 Sep 1998 21:05:59 -0000 1.1 +++ usr.bin/shuffle/Makefile 25 Aug 2006 17:12:07 -0000 @@ -2,4 +2,7 @@ PROG= shuffle +LDADD+=-lutil +DPADD+=${LIBUTIL} + .include Index: usr.bin/shuffle/shuffle.c =================================================================== RCS file: /cvsroot/src/usr.bin/shuffle/shuffle.c,v retrieving revision 1.18 diff -u -u -r1.18 shuffle.c --- usr.bin/shuffle/shuffle.c 1 Dec 2004 00:03:45 -0000 1.18 +++ usr.bin/shuffle/shuffle.c 25 Aug 2006 17:12:07 -0000 @@ -45,10 +45,7 @@ #include #include #include - -static void enomem(void); -static void *emalloc(size_t); -static void *erealloc(void *, size_t); +#include static size_t *get_shuffle(size_t); static void usage(void); @@ -58,42 +55,6 @@ int main(int, char *[]); /* - * enomem -- - * die when out of memory. - */ -static void -enomem(void) -{ - errx(2, "Cannot allocate memory."); -} - -/* - * emalloc -- - * malloc, but die on error. - */ -static void * -emalloc(size_t len) -{ - void *p; - - if ((p = malloc(len)) == NULL) - enomem(); - return p; -} - -/* - * erealloc -- - * realloc, but die on error. - */ -void * -erealloc(void *ptr, size_t size) -{ - if ((ptr = realloc(ptr, size)) == NULL) - enomem(); - return ptr; -} - -/* * get_shuffle -- * Construct a random shuffle array of t elements */ Index: usr.bin/spell/spellprog/Makefile =================================================================== RCS file: /cvsroot/src/usr.bin/spell/spellprog/Makefile,v retrieving revision 1.2 diff -u -u -r1.2 Makefile --- usr.bin/spell/spellprog/Makefile 30 Jun 2005 16:25:05 -0000 1.2 +++ usr.bin/spell/spellprog/Makefile 25 Aug 2006 17:12:07 -0000 @@ -6,4 +6,7 @@ SRCS= spellprog.c look.c BINDIR= /usr/libexec +LDADD+=-lutil +DPADD+=${LIBUTIL} + .include Index: usr.bin/spell/spellprog/spellprog.c =================================================================== RCS file: /cvsroot/src/usr.bin/spell/spellprog/spellprog.c,v retrieving revision 1.4 diff -u -u -r1.4 spellprog.c --- usr.bin/spell/spellprog/spellprog.c 17 Jul 2005 17:08:25 -0000 1.4 +++ usr.bin/spell/spellprog/spellprog.c 25 Aug 2006 17:12:07 -0000 @@ -94,6 +94,7 @@ #include #include #include +#include #include "extern.h" @@ -106,7 +107,6 @@ static int vowel(int); static const char *lookuppref(char **, char *); static char *skipv(char *); -static char *estrdup(const char *); static void ise(void); static void print_word(FILE *); static void ztos(char *); @@ -789,16 +789,6 @@ *st = 's'; } -static char * -estrdup(const char *st) -{ - char *d; - - if ((d = strdup(st)) == NULL) - err(1, "strdup"); - return d; -} - /* * Look up a word in the dictionary. * Returns 1 if found, 0 if not. Index: usr.sbin/gspa/gspa/Makefile =================================================================== RCS file: /cvsroot/src/usr.sbin/gspa/gspa/Makefile,v retrieving revision 1.10 diff -u -u -r1.10 Makefile --- usr.sbin/gspa/gspa/Makefile 1 Aug 2003 17:04:07 -0000 1.10 +++ usr.sbin/gspa/gspa/Makefile 25 Aug 2006 17:12:08 -0000 @@ -8,4 +8,7 @@ gsp_inst.c gsp_pseu.c gsp_gram.y YHEADER=1 +LDADD+=-lutil +DPADD+=${LIBUTIL} + .include Index: usr.sbin/gspa/gspa/gsp_act.c =================================================================== RCS file: /cvsroot/src/usr.sbin/gspa/gspa/gsp_act.c,v retrieving revision 1.4 diff -u -u -r1.4 gsp_act.c --- usr.sbin/gspa/gspa/gsp_act.c 13 Jun 2001 10:46:06 -0000 1.4 +++ usr.sbin/gspa/gspa/gsp_act.c 25 Aug 2006 17:12:08 -0000 @@ -38,6 +38,7 @@ #include #include +#include #include "gsp_ass.h" void Index: usr.sbin/gspa/gspa/gsp_ass.h =================================================================== RCS file: /cvsroot/src/usr.sbin/gspa/gspa/gsp_ass.h,v retrieving revision 1.9 diff -u -u -r1.9 gsp_ass.h --- usr.sbin/gspa/gspa/gsp_ass.h 13 May 2006 22:34:50 -0000 1.9 +++ usr.sbin/gspa/gspa/gsp_ass.h 25 Aug 2006 17:12:09 -0000 @@ -33,7 +33,7 @@ #include #include -/*#include */ +#include #define MAXLINE 133 @@ -119,15 +119,14 @@ #define M_ABSOLUTE 6 /* @adr */ /* Register names */ -#define A0 0x20 -#define B0 0x50 -#define SP 0x6F /* (r1 & r2 & REGFILE) != 0 iff */ -#define REGFILE 0x60 /* r1 and r2 are in the same file */ +#define GSPA_A0 0x20 +#define GSPA_B0 0x50 +#define GSPA_SP 0x6F /* (r1 & r2 & REGFILE) != 0 iff */ +#define GSPA_REGFILE 0x60 /* r1 and r2 are in the same file */ /* Prototypes */ operand abs_adr(expr); operand add_operand(operand, operand); -void *emalloc(size_t nbytes); expr bexpr(int, expr, expr); void do_asg(char *, expr, int flags); void do_list_pc(void); Index: usr.sbin/gspa/gspa/gsp_inst.c =================================================================== RCS file: /cvsroot/src/usr.sbin/gspa/gspa/gsp_inst.c,v retrieving revision 1.7 diff -u -u -r1.7 gsp_inst.c --- usr.sbin/gspa/gspa/gsp_inst.c 25 May 2006 02:50:50 -0000 1.7 +++ usr.sbin/gspa/gspa/gsp_inst.c 25 Aug 2006 17:12:09 -0000 @@ -460,12 +460,12 @@ op1 = NULL; class = ip->class & CLASS; flags = ip->class & ~CLASS; - if( class == MOVE && op0 && op1 && op1->type == REG ){ - if (op0->type == REG ){ + if (class == MOVE && op0 && op1 && op1->type == REG) { + if (op0->type == REG) { class = DYADIC; - if( (op0->reg_no & op1->reg_no & REGFILE) == 0 ){ + if ((op0->reg_no & op1->reg_no & GSPA_REGFILE) == 0) { opc += 0x0200; - op1->reg_no ^= A0^B0; + op1->reg_no ^= GSPA_A0 ^ GSPA_B0; } } else if ( op0->type == EXPR ) class = DYADIC; @@ -505,12 +505,12 @@ if( op1 != NULL ){ rd = op1->reg_no; if( USES_REG(op0) && USES_REG(op1) ){ - if( (rs & rd & REGFILE) == 0 ) + if ((rs & rd & GSPA_REGFILE) == 0) perr("Registers must be in the same register file"); /* force SP to the file of the other operand */ - if( rs == SP ) + if (rs == GSPA_SP) rs |= rd; - if( rd == SP ) + if (rd == GSPA_SP) rd |= rs; } } @@ -668,7 +668,7 @@ break; case MMFM: opc |= rs & 0xF; - file = rs & REGFILE; + file = rs & GSPA_REGFILE; if( op1 == NULL ) mask = 0xFFFF; else if( op1->type == REG ){ @@ -690,9 +690,9 @@ if( op1->next != NULL ) perr("Extra operands ignored"); } - if( (file & A0 & REGFILE) == 0 ) + if ((file & GSPA_A0 & GSPA_REGFILE) == 0) opc |= 0x10; - if( (opc & 0x20) != 0 ){ + if ((opc & 0x20) != 0) { /* mask reversed for MMFM */ rs = 0; for( bit = 16; bit != 0; --bit ){ Index: usr.sbin/gspa/gspa/gsp_lex.c =================================================================== RCS file: /cvsroot/src/usr.sbin/gspa/gspa/gsp_lex.c,v retrieving revision 1.7 diff -u -u -r1.7 gsp_lex.c --- usr.sbin/gspa/gspa/gsp_lex.c 7 Feb 2005 06:50:42 -0000 1.7 +++ usr.sbin/gspa/gspa/gsp_lex.c 25 Aug 2006 17:12:09 -0000 @@ -62,10 +62,14 @@ }; short regnumbers[] = { - A0+0, A0+1, A0+2, A0+3, A0+4, A0+5, A0+6, A0+7, - A0+8, A0+9, A0+10, A0+11, A0+12, A0+13, A0+14, SP, - B0+0, B0+1, B0+2, B0+3, B0+4, B0+5, B0+6, B0+7, - B0+8, B0+9, B0+10, B0+11, B0+12, B0+13, B0+14, B0+15, + GSPA_A0+0, GSPA_A0+1, GSPA_A0+2, GSPA_A0+3, + GSPA_A0+4, GSPA_A0+5, GSPA_A0+6, GSPA_A0+7, + GSPA_A0+8, GSPA_A0+9, GSPA_A0+10, GSPA_A0+11, + GSPA_A0+12, GSPA_A0+13, GSPA_A0+14, GSPA_SP, + GSPA_B0+0, GSPA_B0+1, GSPA_B0+2, GSPA_B0+3, + GSPA_B0+4, GSPA_B0+5, GSPA_B0+6, GSPA_B0+7, + GSPA_B0+8, GSPA_B0+9, GSPA_B0+10, GSPA_B0+11, + GSPA_B0+12, GSPA_B0+13, GSPA_B0+14, GSPA_B0+15, }; void Index: usr.sbin/gspa/gspa/gsp_out.c =================================================================== RCS file: /cvsroot/src/usr.sbin/gspa/gspa/gsp_out.c,v retrieving revision 1.8 diff -u -u -r1.8 gsp_out.c --- usr.sbin/gspa/gspa/gsp_out.c 13 May 2006 22:34:50 -0000 1.8 +++ usr.sbin/gspa/gspa/gsp_out.c 25 Aug 2006 17:12:09 -0000 @@ -39,6 +39,7 @@ #include #include #include +#include #include "gsp_ass.h" u_int16_t codes[5]; Index: usr.sbin/gspa/gspa/gsp_sym.c =================================================================== RCS file: /cvsroot/src/usr.sbin/gspa/gspa/gsp_sym.c,v retrieving revision 1.7 diff -u -u -r1.7 gsp_sym.c --- usr.sbin/gspa/gspa/gsp_sym.c 13 May 2006 22:34:50 -0000 1.7 +++ usr.sbin/gspa/gspa/gsp_sym.c 25 Aug 2006 17:12:09 -0000 @@ -38,6 +38,7 @@ #include #include +#include #include "gsp_ass.h" #define NHASH 64 /* must be power of 2 */ Index: usr.sbin/gspa/gspa/gspa.c =================================================================== RCS file: /cvsroot/src/usr.sbin/gspa/gspa/gspa.c,v retrieving revision 1.11 diff -u -u -r1.11 gspa.c --- usr.sbin/gspa/gspa/gspa.c 13 May 2006 22:34:50 -0000 1.11 +++ usr.sbin/gspa/gspa/gspa.c 25 Aug 2006 17:12:09 -0000 @@ -45,6 +45,7 @@ #include #include #include +#include #include "gsp_ass.h" #include "gsp_gram.h" @@ -290,18 +291,6 @@ longjmp(synerrjmp, 1); } -void * -emalloc(size_t nbytes) -{ - void *p; - - if( (p = malloc(nbytes)) == NULL ){ - fprintf(stderr, "Insufficient memory at line %d\n", lineno); - exit(1); - } - return p; -} - void usage() { Index: usr.sbin/mountd/mountd.c =================================================================== RCS file: /cvsroot/src/usr.sbin/mountd/mountd.c,v retrieving revision 1.109 diff -u -u -r1.109 mountd.c --- usr.sbin/mountd/mountd.c 31 Jul 2006 16:34:45 -0000 1.109 +++ usr.sbin/mountd/mountd.c 25 Aug 2006 17:12:11 -0000 @@ -217,8 +217,6 @@ static int xdr_explist __P((XDR *, caddr_t)); static int xdr_fhs __P((XDR *, caddr_t)); static int xdr_mlist __P((XDR *, caddr_t)); -static void *emalloc __P((size_t)); -static char *estrdup __P((const char *)); static int bitcmp __P((void *, void *, int)); static int netpartcmp __P((struct sockaddr *, struct sockaddr *, int)); static int sacmp __P((struct sockaddr *, struct sockaddr *)); @@ -1944,35 +1942,6 @@ #endif /* ISO */ /* - * error checked malloc and strdup - */ -static void * -emalloc(n) - size_t n; -{ - void *ptr = malloc(n); - - if (ptr == NULL) { - syslog(LOG_ERR, "%m"); - exit(2); - } - return ptr; -} - -static char * -estrdup(s) - const char *s; -{ - char *n = strdup(s); - - if (n == NULL) { - syslog(LOG_ERR, "%m"); - exit(2); - } - return n; -} - -/* * Do the nfssvc syscall to push the export info into the kernel. */ static int Index: usr.sbin/netgroup_mkdb/Makefile =================================================================== RCS file: /cvsroot/src/usr.sbin/netgroup_mkdb/Makefile,v retrieving revision 1.3 diff -u -u -r1.3 Makefile --- usr.sbin/netgroup_mkdb/Makefile 4 Oct 1996 05:15:27 -0000 1.3 +++ usr.sbin/netgroup_mkdb/Makefile 25 Aug 2006 17:12:11 -0000 @@ -2,7 +2,10 @@ # $NetBSD: Makefile,v 1.3 1996/10/04 05:15:27 christos Exp $ PROG= netgroup_mkdb -SRCS= netgroup_mkdb.c util.c str.c +SRCS= netgroup_mkdb.c str.c MAN= netgroup_mkdb.8 +LDADD+=-lutil +DPADD+=${LIBUTIL} + .include Index: usr.sbin/netgroup_mkdb/netgroup_mkdb.c =================================================================== RCS file: /cvsroot/src/usr.sbin/netgroup_mkdb/netgroup_mkdb.c,v retrieving revision 1.14 diff -u -u -r1.14 netgroup_mkdb.c --- usr.sbin/netgroup_mkdb/netgroup_mkdb.c 27 Jul 2006 15:29:07 -0000 1.14 +++ usr.sbin/netgroup_mkdb/netgroup_mkdb.c 25 Aug 2006 17:12:11 -0000 @@ -222,7 +222,7 @@ if (db == NULL) err(1, "dbopen"); - while ((buf = getline(fp, &size)) != NULL) { + while ((buf = fparseln(fp, &size, NULL, NULL, 0)) != NULL) { tail = head = NULL; p = buf; Index: usr.sbin/netgroup_mkdb/str.c =================================================================== RCS file: /cvsroot/src/usr.sbin/netgroup_mkdb/str.c,v retrieving revision 1.5 diff -u -u -r1.5 str.c --- usr.sbin/netgroup_mkdb/str.c 27 Jul 2006 15:29:07 -0000 1.5 +++ usr.sbin/netgroup_mkdb/str.c 25 Aug 2006 17:12:11 -0000 @@ -41,8 +41,9 @@ */ #include #include +#include +#include -#include "util.h" #include "str.h" /* Index: usr.sbin/ntp/libntp/Makefile =================================================================== RCS file: /cvsroot/src/usr.sbin/ntp/libntp/Makefile,v retrieving revision 1.8 diff -u -u -r1.8 Makefile --- usr.sbin/ntp/libntp/Makefile 11 Jun 2006 19:34:22 -0000 1.8 +++ usr.sbin/ntp/libntp/Makefile 25 Aug 2006 17:12:12 -0000 @@ -7,7 +7,7 @@ audio.c authkeys.c authreadkeys.c authusekey.c \ buftvtots.c caljulian.c caltontp.c calyearstart.c \ clocktime.c clocktypes.c decodenetnum.c dofptoa.c dolfptoa.c \ - emalloc.c findconfig.c fptoa.c fptoms.c getopt.c hextoint.c \ + findconfig.c fptoa.c fptoms.c getopt.c hextoint.c \ hextolfp.c humandate.c icom.c inttoa.c iosignal.c lib_strbuf.c \ machines.c md5c.c \ memmove.c mfptoa.c mfptoms.c mktime.c modetoa.c mstolfp.c msutotsf.c \ Index: usr.sbin/ntp/ntpd/Makefile =================================================================== RCS file: /cvsroot/src/usr.sbin/ntp/ntpd/Makefile,v retrieving revision 1.14 diff -u -u -r1.14 Makefile --- usr.sbin/ntp/ntpd/Makefile 29 Jul 2006 08:18:36 -0000 1.14 +++ usr.sbin/ntp/ntpd/Makefile 25 Aug 2006 17:12:12 -0000 @@ -27,7 +27,7 @@ LDADD+= -L${LIBPARSE} -lparse -L${LIBISC} -lisc DPADD+= ${LIBPARSE}/libparse.a ${LIBISC}/libisc.a -LDADD+= -lm -DPADD+= ${LIBM} +LDADD+= -lutil -lm +DPADD+= ${LIBUTIL} ${LIBM} .include Index: usr.sbin/ntp/ntpdate/Makefile =================================================================== RCS file: /cvsroot/src/usr.sbin/ntp/ntpdate/Makefile,v retrieving revision 1.5 diff -u -u -r1.5 Makefile --- usr.sbin/ntp/ntpdate/Makefile 29 Jul 2006 08:18:36 -0000 1.5 +++ usr.sbin/ntp/ntpdate/Makefile 25 Aug 2006 17:12:12 -0000 @@ -9,7 +9,7 @@ LDADD+= -L${LIBISC} -lisc DPADD+= ${LIBISC}/libisc.a -LDADD+= -lm -DPADD+= ${LIBM} +LDADD+= -lutil -lm +DPADD+= ${LIBUTIL} ${LIBM} .include Index: usr.sbin/sup/Makefile.inc =================================================================== RCS file: /cvsroot/src/usr.sbin/sup/Makefile.inc,v retrieving revision 1.8 diff -u -u -r1.8 Makefile.inc --- usr.sbin/sup/Makefile.inc 3 Apr 2003 17:56:52 -0000 1.8 +++ usr.sbin/sup/Makefile.inc 25 Aug 2006 17:12:12 -0000 @@ -10,6 +10,8 @@ LIBSUPDIR != cd ${.CURDIR}/../lib && ${PRINTOBJDIR} LIBSUP= ${LIBSUPDIR}/libsup.a SUPLIB= -L${LIBSUPDIR} -lsup +LDADD+=-lutil +DPADD+=${LIBUTIL} .if exists(${.CURDIR}/../../Makefile.inc) .include "${.CURDIR}/../../Makefile.inc" Index: usr.sbin/sup/lib/Makefile =================================================================== RCS file: /cvsroot/src/usr.sbin/sup/lib/Makefile,v retrieving revision 1.11 diff -u -u -r1.11 Makefile --- usr.sbin/sup/lib/Makefile 2 Apr 2006 01:39:48 -0000 1.11 +++ usr.sbin/sup/lib/Makefile 25 Aug 2006 17:12:12 -0000 @@ -6,7 +6,7 @@ SRCS= scm.c scmio.c stree.c log.c supmsg.c netcrypt.c SRCS+= atoo.c errmsg.c expand.c ffilecopy.c filecopy.c \ - nxtarg.c path.c quit.c run.c estrdup.c skipto.c + nxtarg.c path.c quit.c run.c skipto.c .PATH: ${.CURDIR}/../source