From beb66b02a40d0938703fb361b9ec41f7fdd461a3 Mon Sep 17 00:00:00 2001 From: Maxim Konovalov Date: Sun, 16 Apr 2006 17:44:49 +0000 Subject: [PATCH] o Close an output file -o flag opened before execvp(3) in a child. PR: bin/89666 Submitted by: Arne H Juul MFC after: 1 month --- usr.bin/time/time.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.bin/time/time.c b/usr.bin/time/time.c index 53f96368cba5..137267b270cc 100644 --- a/usr.bin/time/time.c +++ b/usr.bin/time/time.c @@ -121,6 +121,8 @@ main(int argc, char **argv) err(1, "time"); /* NOTREACHED */ case 0: /* child */ + if (ofn) + fclose(out); execvp(*argv, argv); err(errno == ENOENT ? 127 : 126, "%s", *argv); /* NOTREACHED */