Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/gen don't depend on expandtc to open the database o...



details:   https://anonhg.NetBSD.org/src/rev/1b73bddb13c5
branches:  trunk
changeset: 796940:1b73bddb13c5
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jun 26 20:14:32 2014 +0000

description:
don't depend on expandtc to open the database or not.

diffstat:

 lib/libc/gen/getcap.c |  20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diffs (49 lines):

diff -r 8dec23ed9b3d -r 1b73bddb13c5 lib/libc/gen/getcap.c
--- a/lib/libc/gen/getcap.c     Thu Jun 26 07:50:29 2014 +0000
+++ b/lib/libc/gen/getcap.c     Thu Jun 26 20:14:32 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getcap.c,v 1.52 2012/06/04 20:56:40 joerg Exp $        */
+/*     $NetBSD: getcap.c,v 1.53 2014/06/26 20:14:32 christos Exp $     */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)getcap.c   8.3 (Berkeley) 3/25/94";
 #else
-__RCSID("$NetBSD: getcap.c,v 1.52 2012/06/04 20:56:40 joerg Exp $");
+__RCSID("$NetBSD: getcap.c,v 1.53 2014/06/26 20:14:32 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -254,13 +254,6 @@
 getent(char **cap, size_t *len, const char * const *db_array, int fd,
     const char *name, int depth, char *nfield)
 {
-#ifndef SMALL
-       DB *capdbp;
-       char pbuf[MAXPATHLEN];
-       char *cbuf;
-       int retval;
-       size_t clen;
-#endif
        char *record, *newrecord;
        char *r_end, *rp;       /* pacify gcc */
        const char * const *db_p;
@@ -322,9 +315,14 @@
                        (void)lseek(fd, (off_t)0, SEEK_SET);
                } else {
 #ifndef SMALL
+                       DB *capdbp;
+                       char pbuf[MAXPATHLEN];
+                       char *cbuf;
+                       int retval;
+                       size_t clen;
+
                        (void)snprintf(pbuf, sizeof(pbuf), "%s.db", *db_p);
-                       if (expandtc &&
-                           (capdbp = dbopen(pbuf, O_RDONLY, 0, DB_HASH, 0))
+                       if ((capdbp = dbopen(pbuf, O_RDONLY, 0, DB_HASH, 0))
                             != NULL) {
                                free(record);
                                retval = cdbget(capdbp, &record, name);



Home | Main Index | Thread Index | Old Index