summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2004-08-13 12:49:30 +0000
committerJeremy Katz <katzj@redhat.com>2004-08-13 12:49:30 +0000
commit58c2c7f655e29f3b288601e23cc9436e4b939323 (patch)
tree55b8b70f99f22afa138758d947fc6bfa13b889ae
parent6f4c35c362c8f6e8a33fe9d61c826eea8597ec34 (diff)
downloadanaconda-58c2c7f655e29f3b288601e23cc9436e4b939323.tar.gz
anaconda-58c2c7f655e29f3b288601e23cc9436e4b939323.tar.xz
anaconda-58c2c7f655e29f3b288601e23cc9436e4b939323.zip
oops, forgot a part of the ppc console fix. also, only close fd
if it's > 2 (otherwise, we close one of the fds we expected to have open)
-rw-r--r--loader2/init.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/loader2/init.c b/loader2/init.c
index 995022a88..0ce08baea 100644
--- a/loader2/init.c
+++ b/loader2/init.c
@@ -555,7 +555,7 @@ int main(int argc, char **argv) {
}
setupTerminal(fd);
- } else {
+ } else if (fd < 0) {
fd = open("/dev/tty1", O_RDWR, 0);
if (fd < 0)
fd = open("/dev/vc/1", O_RDWR, 0);
@@ -572,7 +572,8 @@ int main(int argc, char **argv) {
dup2(fd, 0);
dup2(fd, 1);
dup2(fd, 2);
- close(fd);
+ if (fd > 2)
+ close(fd);
#else
dup2(0, 1);
dup2(0, 2);