diff options
-rw-r--r-- | lib/libc_r/uthread/uthread_close.c | 4 |
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); } |