From 61fa6d584f2a1d06f68040020abc52efa722830c Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Sat, 31 May 2003 05:23:20 +0000 Subject: [PATCH] Fixed another bug in the threaded close() call; clear the stale stdio descriptors flags. PR: bin/51535 Submitted by: Enache Adrian Reviewed by: deischen Approved by: re (scottl) --- lib/libc_r/uthread/uthread_close.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libc_r/uthread/uthread_close.c b/lib/libc_r/uthread/uthread_close.c index dedd3e9df53..0847fcd1152 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); }