diff options
author | Scott James Remnant <scott@netsplit.com> | 2009-12-04 11:02:31 -0500 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2009-12-04 11:02:31 -0500 |
commit | 7899b6092a482a42fe828cbaf752c4b06cf1b02c (patch) | |
tree | 481f58126bcdf776c0a8aee878886a3c0c636f77 | |
parent | 9ed3080fc6d70b70f974d64fc20c46d1b683f2b2 (diff) |
[main] Fix fd leak
When redirecting stdio to the tty, the
tty was opened and its fd was dup()'d to
the standard ones, but then wasn't closed.
-rw-r--r-- | src/main.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -1403,6 +1403,8 @@ redirect_standard_io_to_device (const char *device) dup2 (fd, STDOUT_FILENO); dup2 (fd, STDERR_FILENO); + close (fd); + return true; } |