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
This commit is contained in:
Maxim Konovalov 2006-04-16 17:44:49 +00:00
parent 9b63b79ee0
commit beb66b02a4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=157796

View File

@ -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 */