version 1.1.1.1, 1995/02/25 09:11:40 |
version 1.10.4.1, 1996/09/16 18:40:22 |
|
|
|
/* $NetBSD$ */ |
|
|
/*- |
/*- |
* Copyright (c) 1992, 1993 |
* Copyright (c) 1992, 1993 |
* The Regents of the University of California. All rights reserved. |
* The Regents of the University of California. All rights reserved. |
|
|
*/ |
*/ |
|
|
#if defined(LIBC_SCCS) && !defined(lint) |
#if defined(LIBC_SCCS) && !defined(lint) |
|
#if 0 |
static char sccsid[] = "@(#)getcap.c 8.3 (Berkeley) 3/25/94"; |
static char sccsid[] = "@(#)getcap.c 8.3 (Berkeley) 3/25/94"; |
|
#else |
|
static char rcsid[] = "$NetBSD$"; |
|
#endif |
#endif /* LIBC_SCCS and not lint */ |
#endif /* LIBC_SCCS and not lint */ |
|
|
|
#include "namespace.h" |
#include <sys/types.h> |
#include <sys/types.h> |
|
|
#include <ctype.h> |
#include <ctype.h> |
Line 242 getent(cap, len, db_array, fd, name, dep |
|
Line 249 getent(cap, len, db_array, fd, name, dep |
|
*/ |
*/ |
|
|
if (fd >= 0) { |
if (fd >= 0) { |
(void)lseek(fd, (off_t)0, L_SET); |
(void)lseek(fd, (off_t)0, SEEK_SET); |
myfd = 0; |
myfd = 0; |
} else { |
} else { |
(void)snprintf(pbuf, sizeof(pbuf), "%s.db", *db_p); |
(void)snprintf(pbuf, sizeof(pbuf), "%s.db", *db_p); |
Line 270 getent(cap, len, db_array, fd, name, dep |
|
Line 277 getent(cap, len, db_array, fd, name, dep |
|
fd = open(*db_p, O_RDONLY, 0); |
fd = open(*db_p, O_RDONLY, 0); |
if (fd < 0) { |
if (fd < 0) { |
/* No error on unfound file. */ |
/* No error on unfound file. */ |
if (errno == ENOENT) |
continue; |
continue; |
|
free(record); |
|
return (-2); |
|
} |
} |
myfd = 1; |
myfd = 1; |
} |
} |