diff options
-rw-r--r-- | lib/libc/gen/nlist.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c index 6e304e6f7ed..347982a3123 100644 --- a/lib/libc/gen/nlist.c +++ b/lib/libc/gen/nlist.c @@ -281,6 +281,21 @@ static struct nlist_handlers { #endif }; +__fdnlist(fd, list) + register int fd; + register struct nlist *list; +{ + int n, i; + + for (i = 0; i < sizeof(nlist_fn)/sizeof(nlist_fn[0]); i++) { + n = (nlist_fn[i].fn)(fd, list); + if (n != -1) + break; + } + return (n); +} + + int nlist(name, list) const char *name; @@ -292,11 +307,7 @@ nlist(name, list) fd = open(name, O_RDONLY, 0); if (fd < 0) return (-1); - for (i = 0; i < sizeof(nlist_fn)/sizeof(nlist_fn[0]); i++) { - n = (nlist_fn[i].fn)(fd, list); - if (n != -1) - break; - } + n = __fdnlist(fd, list); (void)close(fd); return (n); } |