Ensure that a serial port is set up before used.

This commit is contained in:
okuji committed 2001-10-13 12:02:30 +00:00
1 parent a8ac7eb3f9
commit 61928d1323
11 files changed
+58 -11

No files matched your search

+12 -3
View File
@@ -3914,9 +3914,18 @@ terminal_func (char *arg, int flags)
#ifdef SUPPORT_SERIAL
else if (grub_memcmp (arg, "serial", sizeof ("serial") - 1) == 0)
{
terminal |= TERMINAL_SERIAL;
if (! default_terminal)
default_terminal = TERMINAL_SERIAL;
if (serial_exists ())
{
terminal |= TERMINAL_SERIAL;
if (! default_terminal)
default_terminal = TERMINAL_SERIAL;
}
else
{
terminal = saved_terminal;
errnum = ERR_NEED_SERIAL;
return 1;
}
}
#endif /* SUPPORT_SERIAL */
else