diff options
| author | christos <christos@NetBSD.org> | 2006-08-26 18:18:16 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2006-08-26 18:18:16 +0000 |
| commit | 5a7156cc58ff6d52fa856d3ffad9073f6c8cfbd4 (patch) | |
| tree | c30cdeed12a99c9b0f2af94efb48f329a8eb6a36 /libexec/makewhatis/makewhatis.c | |
| parent | cdab3a7a065313dbbaaed36ef839e4ba6aa88f88 (diff) | |
use efun(3)
Diffstat (limited to 'libexec/makewhatis/makewhatis.c')
| -rw-r--r-- | libexec/makewhatis/makewhatis.c | 25 |
1 files changed, 3 insertions, 22 deletions
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 <sys/types.h> @@ -67,6 +67,7 @@ __RCSID("$NetBSD: makewhatis.c,v 1.39 2006/04/10 14:39:06 chuck Exp $"); #include <string.h> #include <unistd.h> #include <zlib.h> +#include <util.h> #include <man/manconf.h> #include <man/pathnames.h> @@ -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; -} |
