summaryrefslogtreecommitdiffstats
path: root/lib/libc_r
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2003-05-31 05:23:20 +0000
committerru <ru@FreeBSD.org>2003-05-31 05:23:20 +0000
commit716d37783dec9861538f49d39809d26ee18d0cd4 (patch)
tree038cebd7ab0a65a44ebed679d69bf9709d6dcea0 /lib/libc_r
parent1c938f7a9e304a2c64368e6fb3cff2d83bd4d9a4 (diff)
downloadFreeBSD-src-716d37783dec9861538f49d39809d26ee18d0cd4.zip
FreeBSD-src-716d37783dec9861538f49d39809d26ee18d0cd4.tar.gz
Fixed another bug in the threaded close() call; clear the
stale stdio descriptors flags. PR: bin/51535 Submitted by: Enache Adrian <enache@rdslink.ro> Reviewed by: deischen Approved by: re (scottl)
Diffstat (limited to 'lib/libc_r')
-rw-r--r--lib/libc_r/uthread/uthread_close.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libc_r/uthread/uthread_close.c b/lib/libc_r/uthread/uthread_close.c
index dedd3e9..0847fcd 100644
--- a/lib/libc_r/uthread/uthread_close.c
+++ b/lib/libc_r/uthread/uthread_close.c
@@ -98,6 +98,10 @@ _close(int fd)
_thread_fd_table[fd] = NULL;
free(entry);
+ /* Drop stale pthread stdio descriptor flags. */
+ if (fd < 3)
+ _pthread_stdio_flags[fd] = -1;
+
/* Close the file descriptor: */
ret = __sys_close(fd);
}
OpenPOWER on IntegriCloud