summaryrefslogtreecommitdiffstats
path: root/usr.bin/time/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/time/time.c')
-rw-r--r--usr.bin/time/time.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/usr.bin/time/time.c b/usr.bin/time/time.c
index ebee542..c2ea522 100644
--- a/usr.bin/time/time.c
+++ b/usr.bin/time/time.c
@@ -112,7 +112,7 @@ main(int argc, char **argv)
argv += optind;
if (ofn) {
- if ((out = fopen(ofn, aflag ? "a" : "w")) == NULL)
+ if ((out = fopen(ofn, aflag ? "ae" : "we")) == NULL)
err(1, "%s", ofn);
setvbuf(out, (char *)NULL, _IONBF, (size_t)0);
}
@@ -123,8 +123,6 @@ 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 */
OpenPOWER on IntegriCloud