summaryrefslogtreecommitdiffstats
path: root/usr.bin/ar/replace.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/ar/replace.c')
-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