From 43b4fd733db049c2d23f19d1841acffa0deeea79 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sun, 21 Mar 1999 03:45:58 +0000 Subject: [PATCH] Don't be so selective about which errors cause us to continue and which ones cause us to fail. Now all open errors on the databse file will cause the next file in the list to be tried. Submitted by: Arne Henrik Juul PR: 4585 --- lib/libc/gen/getcap.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/libc/gen/getcap.c b/lib/libc/gen/getcap.c index aaee0ddc359..90fbd18a291 100644 --- a/lib/libc/gen/getcap.c +++ b/lib/libc/gen/getcap.c @@ -267,13 +267,8 @@ getent(cap, len, db_array, fd, name, depth, nfield) return (retval); } else { fd = open(*db_p, O_RDONLY, 0); - if (fd < 0) { - /* No error on unfound file. */ - if (errno == ENOENT) - continue; - free(record); - return (-2); - } + if (fd < 0) + continue; myfd = 1; } }