diff options
author | Jeremy Katz <katzj@redhat.com> | 2004-11-23 03:21:31 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2004-11-23 03:21:31 +0000 |
commit | 03117aedf0ba3b5c549a0bbbdb0b9c944d8d6283 (patch) | |
tree | af046e5453958404a5e85786ecff8b2dd8073abd /loader2/init.c | |
parent | f8a7c188fb9dbda2cf1cbc9637e190dce7fa5e00 (diff) | |
download | anaconda-03117aedf0ba3b5c549a0bbbdb0b9c944d8d6283.tar.gz anaconda-03117aedf0ba3b5c549a0bbbdb0b9c944d8d6283.tar.xz anaconda-03117aedf0ba3b5c549a0bbbdb0b9c944d8d6283.zip |
2004-11-22 Jeremy Katz <katzj@redhat.com>
* loader2/init.c: Only open /dev/console once.
Diffstat (limited to 'loader2/init.c')
-rw-r--r-- | loader2/init.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/loader2/init.c b/loader2/init.c index e0089037e..a2a5baa49 100644 --- a/loader2/init.c +++ b/loader2/init.c @@ -531,6 +531,13 @@ int main(int argc, char **argv) { "/dev/hvsi0", "/dev/hvsi1", "/dev/hvsi2", /* hvsi for POWER5 */ NULL }; + struct termios cmode, mode; + int cfd; + + cfd = open("/dev/console", O_RDONLY); + tcgetattr(cfd,&cmode); + close(cfd); + #elif defined (__ia64__) char * consoles[] = { "/dev/ttySG0", NULL }; #else @@ -538,13 +545,6 @@ int main(int argc, char **argv) { #endif for (i = 0; consoles[i] != NULL; i++) { #if defined(__powerpc__) - int cfd; - struct termios cmode, mode; - - cfd = open("/dev/console", O_RDONLY); - tcgetattr(cfd,&cmode); - close(cfd); - if ((fd = open(consoles[i], O_RDWR)) >= 0 && !tcgetattr(fd, &mode) && !termcmp(&cmode, &mode)) { #else if ((fd = open(consoles[i], O_RDWR)) >= 0) { |