From cfc22f90268457ebcf2d169b2c29ac03e9bc33ca Mon Sep 17 00:00:00 2001 From: David Greenman Date: Mon, 9 Jan 1995 04:50:30 +0000 Subject: [PATCH] Old fix from Robert Crowe that has been sitting in my mailbox since early last year. Fixes a problem with running out of fds (by hitting the limit or whatever) when ar is given a long list of objects. The fix was to add a missing close(). Submitted by: Robert Crowe --- usr.bin/ar/replace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.bin/ar/replace.c b/usr.bin/ar/replace.c index cc12781764e..11cdfd07b13 100644 --- a/usr.bin/ar/replace.c +++ b/usr.bin/ar/replace.c @@ -102,8 +102,10 @@ replace(argv) goto useold; } (void)fstat(sfd, &sb); - if (options & AR_U && sb.st_mtime <= chdr.date) + if (options & AR_U && sb.st_mtime <= chdr.date) { + (void) close(sfd); goto useold; + } if (options & AR_V) (void)printf("r - %s\n", file);