From owner-freebsd-bugs Tue Apr 24 6:40:16 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id DDF4537B424 for ; Tue, 24 Apr 2001 06:40:06 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f3ODe6Y52380; Tue, 24 Apr 2001 06:40:06 -0700 (PDT) (envelope-from gnats) Received: from sanga.paris.none.net (nat133.libertysurfpro.net [212.129.0.133]) by hub.freebsd.org (Postfix) with ESMTP id 77CEC37B43E for ; Tue, 24 Apr 2001 06:30:01 -0700 (PDT) (envelope-from clement@freesbee.fr) Received: from polom.mouarf.org ([212.129.8.240]) by nil.paris.none.net (InterMail vM.4.01.02.17 201-229-119) with ESMTP id <20010424132846.NRBX6451.nil.paris.none.net@polom.mouarf.org> for ; Tue, 24 Apr 2001 15:28:46 +0200 Received: (from clement@localhost) by polom.mouarf.org (8.11.3/8.11.3) id f3OESm601342; Tue, 24 Apr 2001 16:28:48 +0200 (CEST) (envelope-from clement) Message-Id: <200104241428.f3OESm601342@polom.mouarf.org> Date: Tue, 24 Apr 2001 16:28:48 +0200 (CEST) From: clement@asso.ups-tlse.fr Reply-To: clement@asso.ups-tlse.fr To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: bin/26817: [PATCH] isdnd in fullscreen-mode fails to detect read error from tty Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 26817 >Category: bin >Synopsis: isdnd in fullscreen-mode fails to detect read error from tty >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Apr 24 06:40:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Clement Ballabriga >Release: FreeBSD 4.3-STABLE i386 >Organization: none >Environment: System: FreeBSD polom.mouarf.org 4.3-STABLE FreeBSD 4.3-STABLE #0: Sat Apr 21 21:25:21 CEST 2001 root@polom.mouarf.org:/usr/src/sys/compile/POLOM i386 >Description: isdnd, when running in full-screen mode, fails to detect read errors fro m its controlling tty (for exemple when the tty has been revoke()'d). It happens in a loop with a select() in it. The tty is in the read fd_set, and, when the tty's fd is no longer readable, isdnd fails to detect it and keep this fd in the read fd_set, causing select() to return immediately each time, and making isdnd use all CPU resources. Because of the default value of isdn_fsdev in /etc/defaults/rc.conf, isdnd is launched by default in full-screen mode, on terminal /dev/ttyv4. getty(8) uses this console, so when getty is started, isdnd can no longer read /dev/ttyv4, and the problem described above happens. >How-To-Repeat: Configure isdn in kernel and isdnd, put isdn_enable in /etc/rc.conf. Do not change the default value for isdn_fsdev, and reboot. >Fix: Here is a patch for isdnd. If it can't read from its controlling termina l, it puts an error in the log file and exits.(the patch is for the file main.c of isdnd, src/usr.sbin/i4b/isdnd/main.c) --- main.c.old Sun Apr 22 23:33:37 2001 +++ main.c Sun Apr 22 23:37:25 2001 @@ -610,6 +610,12 @@ { int ch = getch(); + if (ch == ERR) + { + log(LL_ERR, "kbdrdhdl: ERROR, read error on controlling tty, errno = %d!", errno); + error_exit(1, "kbdrdhdl: ERROR, read error on controlling tty, errno = %d!", errno); + } + switch(ch) { case 0x0c: /* control L */ >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message