From b31dde27bfeaed94b1026c0788c4e98b1af47f3c Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 13 Feb 1998 01:27:34 +0000 Subject: Fixes from Jeremy Allison and Terry Lambert for pthreads: specifically: uthread_accept.c: Fix for inherited socket not getting correct entry in pthread flags. uthread_create.c: Fix to allow pthread_t pointer return to be null if caller doesn't care about return. uthread_fd.c: Fix for return codes to be placed into correct errno. uthread_init.c: Changes to make gcc-2.8 thread aware for exception stack frames (WARNING: This is #ifdef'ed out by default and is different from the Cygnus egcs fix). uthread_ioctl.c: Fix for blocking/non-blocking ioctl. uthread_kern.c: Signal handling fixes (only one case left to fix, that of an externally sent SIGSEGV and friends - a fairly unusual case). uthread_write.c: Fix for lock of fd - ask for write lock, not read/write. uthread_writev.c: Fix for lock of fd - ask for write lock, not read/write. Pthreads now works well enough to run the LDAP and ACAPD(with the gcc 2.8 fix) sample implementations. --- lib/libc_r/uthread/uthread_accept.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/libc_r/uthread/uthread_accept.c') diff --git a/lib/libc_r/uthread/uthread_accept.c b/lib/libc_r/uthread/uthread_accept.c index 1078bfe..261fa15 100644 --- a/lib/libc_r/uthread/uthread_accept.c +++ b/lib/libc_r/uthread/uthread_accept.c @@ -94,12 +94,11 @@ accept(int fd, struct sockaddr * name, int *namelen) * set the new socket flags to non-blocking, as that * will be the inherited state of the new socket. */ - if((_thread_fd_table[fd]->flags & O_NONBLOCK) == 0) + if((ret > 0) && (_thread_fd_table[fd]->flags & O_NONBLOCK) == 0) _thread_fd_table[ret]->flags &= ~O_NONBLOCK; /* Unlock the file descriptor: */ _thread_fd_unlock(fd, FD_RDWR); - } /* Return the socket file descriptor or -1 on error: */ return (ret); -- cgit v1.1