summaryrefslogtreecommitdiffstats
path: root/usr.bin/ar
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-01-09 04:50:30 +0000
committerdg <dg@FreeBSD.org>1995-01-09 04:50:30 +0000
commit4969834bb25d688c299d10843d4c8f7cb2b61e29 (patch)
tree8e382de379a6fc22f26cd2ee6db5936686563f0a /usr.bin/ar
parent09f9300ee1d264c3fd75f41bf763ce4f3b14cf3f (diff)
downloadFreeBSD-src-4969834bb25d688c299d10843d4c8f7cb2b61e29.zip
FreeBSD-src-4969834bb25d688c299d10843d4c8f7cb2b61e29.tar.gz
Old fix from Robert Crowe <bob@speakez.com> 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 <bob@speakez.com>
Diffstat (limited to 'usr.bin/ar')
-rw-r--r--usr.bin/ar/replace.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/ar/replace.c b/usr.bin/ar/replace.c
index cc12781..11cdfd0 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);
OpenPOWER on IntegriCloud