From d387f3a0a99b84c361775c58a44002ed3511c815 Mon Sep 17 00:00:00 2001 From: jkh Date: Tue, 16 Sep 1997 10:14:23 +0000 Subject: MF22: pst's changes. Submitted by: pst --- usr.sbin/sysinstall/termcap.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'usr.sbin/sysinstall/termcap.c') diff --git a/usr.sbin/sysinstall/termcap.c b/usr.sbin/sysinstall/termcap.c index fa9c19f..1569479 100644 --- a/usr.sbin/sysinstall/termcap.c +++ b/usr.sbin/sysinstall/termcap.c @@ -94,17 +94,20 @@ set_termcap(void) if (setenv("TERMCAP", termcap, 1) < 0) return -1; } - if (DebugFD == -1) - DebugFD = dup(1); + if (DebugFD < 0) + DebugFD = open("/dev/null", O_RDWR, 0); } else { int i, on; if (getpid() == 1) { DebugFD = open("/dev/ttyv1", O_WRONLY); - on = 1; - i = ioctl(DebugFD, TIOCCONS, (char *)&on); - msgDebug("ioctl(%d, TIOCCONS, NULL) = %d (%s)\n", DebugFD, i, !i ? "success" : strerror(errno)); + if (DebugFD != -1) { + on = 1; + i = ioctl(DebugFD, TIOCCONS, (char *)&on); + msgDebug("ioctl(%d, TIOCCONS, NULL) = %d (%s)\n", + DebugFD, i, !i ? "success" : strerror(errno)); + } } if (ColorDisplay) { if (!term) { -- cgit v1.1