aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/console_check.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/console_check.c b/src/console_check.c
index 243e9be5..60dc89e2 100644
--- a/src/console_check.c
+++ b/src/console_check.c
@@ -79,7 +79,7 @@ int compare_termios_to_console(char *dev, int *speed) {
tcgetattr(cfd, &cmode);
close(cfd);
- fd = open(dev, O_RDONLY);
+ fd = open(dev, O_RDONLY|O_NONBLOCK);
tcgetattr(fd, &mode);
if (!termcmp(&cmode, &mode)) {
@@ -97,6 +97,9 @@ char *check_serial_console(int *speed) {
char twelve = 12;
struct serial_struct si, si2;
+ memset(&si, 0, sizeof(si));
+ memset(&si2, 0, sizeof(si));
+
fd = open("/dev/console", O_RDWR);
if (ioctl (fd, TIOCLINUX, &twelve) >= 0)
goto out;