From owner-freebsd-bugs Wed Aug 28 11:40: 8 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0998037B400 for ; Wed, 28 Aug 2002 11:40:04 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9A3243E3B for ; Wed, 28 Aug 2002 11:40:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g7SIe3JU029197 for ; Wed, 28 Aug 2002 11:40:03 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g7SIe3YB029196; Wed, 28 Aug 2002 11:40:03 -0700 (PDT) Date: Wed, 28 Aug 2002 11:40:03 -0700 (PDT) Message-Id: <200208281840.g7SIe3YB029196@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Daniel Eischen Subject: Re: bin/42100: libc_r: accept(2) can't handle descriptor being closed/shutdown Reply-To: Daniel Eischen Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/42100; it has been noted by GNATS. From: Daniel Eischen To: Archie Cobbs Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: bin/42100: libc_r: accept(2) can't handle descriptor being closed/shutdown Date: Wed, 28 Aug 2002 14:30:55 -0400 (EDT) Here's a patch that might fix libc_r in the close() case. The original is at home, and I hacked this one up but can't compile it. Please test. Index: uthread_kern.c =================================================================== RCS file: /home/ncvs/src/lib/libc_r/uthread/uthread_kern.c,v retrieving revision 1.41 diff -u -r1.41 uthread_kern.c --- uthread_kern.c 25 Aug 2002 13:06:29 -0000 1.41 +++ uthread_kern.c 28 Aug 2002 18:25:24 -0000 @@ -880,7 +880,8 @@ /* File descriptor read wait: */ case PS_FDR_WAIT: if ((nfds < _thread_dtablesize) && - (_thread_pfd_table[nfds].revents & POLLRDNORM)) { + ((_thread_pfd_table[nfds].revents + & (POLLRDNORM | POLLHUP | POLLERR)) != 0)) { PTHREAD_WAITQ_CLEARACTIVE(); PTHREAD_WORKQ_REMOVE(pthread); PTHREAD_NEW_STATE(pthread,PS_RUNNING); @@ -892,7 +893,8 @@ /* File descriptor write wait: */ case PS_FDW_WAIT: if ((nfds < _thread_dtablesize) && - (_thread_pfd_table[nfds].revents & POLLWRNORM)) { + ((_thread_pfd_table[nfds].revents + & (POLLWRNORM | POLLHUP | POLLERR)) != 0)) { PTHREAD_WAITQ_CLEARACTIVE(); PTHREAD_WORKQ_REMOVE(pthread); PTHREAD_NEW_STATE(pthread,PS_RUNNING); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message