From 5a7156cc58ff6d52fa856d3ffad9073f6c8cfbd4 Mon Sep 17 00:00:00 2001 From: christos Date: Sat, 26 Aug 2006 18:18:16 +0000 Subject: use efun(3) --- libexec/makewhatis/Makefile | 8 +++++--- libexec/makewhatis/makewhatis.c | 25 +++---------------------- 2 files changed, 8 insertions(+), 25 deletions(-) (limited to 'libexec') diff --git a/libexec/makewhatis/Makefile b/libexec/makewhatis/Makefile index 6054ce1495b..cade358a546 100644 --- a/libexec/makewhatis/Makefile +++ b/libexec/makewhatis/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.17 2003/05/18 07:57:32 lukem Exp $ +# $NetBSD: Makefile,v 1.18 2006/08/26 18:18:16 christos Exp $ .include @@ -10,8 +10,10 @@ CPPFLAGS+=-I${NETBSDSRCDIR}/usr.bin MAN= ${PROG}.8 .ifndef HOSTPROG -DPADD= ${LIBZ} -LDADD= -lz +DPADD+= ${LIBZ} +LDADD+= -lz .endif +DPADD+= ${LIBUTIL} +LDADD+= -lutil .include diff --git a/libexec/makewhatis/makewhatis.c b/libexec/makewhatis/makewhatis.c index 6ef6cbf58c6..070f3bba6f9 100644 --- a/libexec/makewhatis/makewhatis.c +++ b/libexec/makewhatis/makewhatis.c @@ -1,4 +1,4 @@ -/* $NetBSD: makewhatis.c,v 1.39 2006/04/10 14:39:06 chuck Exp $ */ +/* $NetBSD: makewhatis.c,v 1.40 2006/08/26 18:18:16 christos Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ #if !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1999 The NetBSD Foundation, Inc.\n\ All rights reserved.\n"); -__RCSID("$NetBSD: makewhatis.c,v 1.39 2006/04/10 14:39:06 chuck Exp $"); +__RCSID("$NetBSD: makewhatis.c,v 1.40 2006/08/26 18:18:16 christos Exp $"); #endif /* not lint */ #include @@ -67,6 +67,7 @@ __RCSID("$NetBSD: makewhatis.c,v 1.39 2006/04/10 14:39:06 chuck Exp $"); #include #include #include +#include #include #include @@ -110,8 +111,6 @@ static char *parsemanpage(const char *, gzFile *, int); 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 @@ dumpwhatis(FILE *out, whatis *tree) 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; -} -- cgit