Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Aug 2002 11:40:03 -0700 (PDT)
From:      Daniel Eischen <eischen@pcnet1.pcnet.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/42100: libc_r: accept(2) can't handle descriptor being closed/shutdown
Message-ID:  <200208281840.g7SIe3YB029196@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/42100; it has been noted by GNATS.

From: Daniel Eischen <eischen@pcnet1.pcnet.com>
To: Archie Cobbs <archie@packetdesign.com>
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208281840.g7SIe3YB029196>