summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2007-06-23 16:56:56 +0000
committerchristos <christos@NetBSD.org>2007-06-23 16:56:56 +0000
commit65c07d0bce8a982fcedc6eaf74073b96199c05ab (patch)
treed0f94f1417e518c88ed361884202dc46a2a8fcfb
parent4f52df9a5ed0182c2ec134f4c3f04ece7ffdddd9 (diff)
fix a comment and use efopen
-rw-r--r--usr.sbin/services_mkdb/uniq.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/usr.sbin/services_mkdb/uniq.c b/usr.sbin/services_mkdb/uniq.c
index 8ae10c6757a..0c90216bc34 100644
--- a/usr.sbin/services_mkdb/uniq.c
+++ b/usr.sbin/services_mkdb/uniq.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uniq.c,v 1.1 2007/06/23 16:55:15 christos Exp $ */
+/* $NetBSD: uniq.c,v 1.2 2007/06/23 16:56:56 christos Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: uniq.c,v 1.1 2007/06/23 16:55:15 christos Exp $");
+__RCSID("$NetBSD: uniq.c,v 1.2 2007/06/23 16:56:56 christos Exp $");
#include <stdio.h>
#include <string.h>
@@ -53,7 +53,7 @@ void uniq(const char *);
static int comp(const char *, char **, size_t *);
/*
- * Preserve only uniq content lines in a file. Input lines that have
+ * Preserve only unique content lines in a file. Input lines that have
* content [alphanumeric characters before a comment] are white-space
* normalized and have their comments removed. Then they are placed
* in a hash table, and only the first instance of them is printed.
@@ -75,9 +75,7 @@ uniq(const char *fname)
if ((db = dbopen(NULL, O_RDWR, 0, DB_HASH, &hinfo)) == NULL)
err(1, "Cannot create in memory database");
- if ((fp = fopen(fname, "r")) == NULL)
- err(1, "Cannot open `%s'", fname);
-
+ fp = efopen(fname, "r");
while ((line = fgetln(fp, &len)) != NULL) {
size_t complen = len;
char *compline;