diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2013-07-19 08:21:17 +0200 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2013-07-22 08:18:50 +0200 |
commit | eed8e77dcf5b9ce9c21919ea6d549b5dd92bb18a (patch) | |
tree | f863fdae5f9f36518090dd705f02cd2571e8466f | |
parent | c676a0cbb705a7164ca1306dc6212a45edcad495 (diff) | |
download | unitd-eed8e77dcf5b9ce9c21919ea6d549b5dd92bb18a.tar unitd-eed8e77dcf5b9ce9c21919ea6d549b5dd92bb18a.zip |
early: remove superfluous close of stdio file descriptors
'man dup2' says:
dup2() makes newfd be the copy of oldfd, closing newfd first if
necessary, but note the following:
* If oldfd is not a valid file descriptor, then the call fails,
and newfd is not closed.
* If oldfd is a valid file descriptor, and newfd has the same
value as oldfd, then dup2() does nothing, and returns newfd.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
-rw-r--r-- | early.c | 4 |
1 files changed, 0 insertions, 4 deletions
@@ -53,10 +53,6 @@ static void early_console(const char *dev) mkdev("*console", 0600); dd = open(dev, O_RDWR); - close(STDIN_FILENO); - close(STDOUT_FILENO); - close(STDERR_FILENO); - if (dd < 0) { ERROR("Failed to open %s\n", dev); return; |