From owner-p4-projects@FreeBSD.ORG Mon Aug 4 15:01:46 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 85938106566B; Mon, 4 Aug 2008 15:01:46 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4961C1065675 for ; Mon, 4 Aug 2008 15:01:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 3CF348FC15 for ; Mon, 4 Aug 2008 15:01:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m74F1kOd064725 for ; Mon, 4 Aug 2008 15:01:46 GMT (envelope-from ed@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m74F1kDL064723 for perforce@freebsd.org; Mon, 4 Aug 2008 15:01:46 GMT (envelope-from ed@FreeBSD.org) Date: Mon, 4 Aug 2008 15:01:46 GMT Message-Id: <200808041501.m74F1kDL064723@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ed@FreeBSD.org using -f From: Ed Schouten To: Perforce Change Reviews Cc: Subject: PERFORCE change 146630 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2008 15:01:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=146630 Change 146630 by ed@ed_flippo on 2008/08/04 15:01:14 Revert a bug I introduced in my previous commit: When the timers are turned on, we should return the amount of bytes read instead of an error when the timer expires. While there, also fix the zombie-case on writes. According to POSIX, we should return EIO. Affected files ... .. //depot/projects/mpsafetty/sys/kern/tty_ttydisc.c#7 edit Differences ... ==== //depot/projects/mpsafetty/sys/kern/tty_ttydisc.c#7 (text+ko) ==== @@ -250,7 +250,7 @@ error = tty_timedwait(tp, &tp->t_inwait, hz); if (error) - return (error); + return (error == EWOULDBLOCK ? 0 : error); } return (0); @@ -441,6 +441,9 @@ tty_lock_assert(tp, MA_OWNED); + if (tp->t_flags & TF_ZOMBIE) + return (EIO); + /* * We don't need to check whether the process is the foreground * process group or if we have a carrier. This is already done @@ -529,6 +532,11 @@ error = tty_wait(tp, &tp->t_outwait); if (error) goto done; + + if (tp->t_flags & TF_ZOMBIE) { + error = EIO; + goto done; + } } while (oblen > 0); }