Paul Brook writes: I'm seeing a hang in applications that open and close files with a non-threaded uClibc.  There is code in fclose() to remove a file handle from _stdio_openlist however it's commented out, allegedly because it is dead. _stdio_openlist is used in several places, including _stdio_term when a program exits. fclose() frees the struct, so I don't see how the code can possibly be redundant.
Paul Brook writes:
I'm seeing a hang in applications that open and close files with a
non-threaded uClibc.  There is code in fclose() to remove a file handle from
_stdio_openlist however it's commented out, allegedly because it is dead.
_stdio_openlist is used in several places, including _stdio_term when a
program exits. fclose() frees the struct, so I don't see how the code can
possibly be redundant.

In the __UCLIBC_HAS_THREADS__ && __STDIO_BUFFERS case the file is removed from
_stdio_openlist by __STDIO_OPENLIST_DEC_USE.

The attached patch fixes this bug be re-enabling the code.

joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc