protect from db-less systems

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6822 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1999-08-16 12:29:14 +00:00
parent 1b26c82957
commit f0140254c2

View File

@@ -44,7 +44,9 @@ RCSID("$Id$");
#include <sys/types.h>
#include <ctype.h>
#ifdef HAVE_DB_H
#include <db.h>
#endif
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
@@ -275,6 +277,9 @@ getent(char **cap, size_t *len, char **db_array, int fd,
if (fd >= 0) {
(void)lseek(fd, (off_t)0, SEEK_SET);
} else {
#ifndef HAVE_DBOPEN
#define dbopen(a, b, c, d, e) NULL
#endif
(void)snprintf(pbuf, sizeof(pbuf), "%s.db", *db_p);
if ((capdbp = dbopen(pbuf, O_RDONLY, 0, DB_HASH, 0))
!= NULL) {