------- Comment #1 from rleigh at debian dot org 2006-01-03 20:52 ------- On further investigation, it looks like when a stdio_filebuf is destroyed, this will ultimately invoke __basic_file<char>::close(). This calls fclose(). If an fd is used, fdopen() is called to create a __c_file*.
If this is correct, then both file descriptors and FILE * objects will be automatically closed, in which case this patch is needed: --- stdio_filebuf.h.old 2006-01-03 18:49:58.653951737 +0000 +++ stdio_filebuf.h 2006-01-03 20:51:22.146153499 +0000 @@ -85,7 +85,7 @@ * Defaults to system's @c BUFSIZ. * * This constructor associates a file stream buffer with an open - * C @c FILE*. The @c FILE* will not be automatically closed when the + * C @c FILE*. The @c FILE* will be automatically closed when the * stdio_filebuf is closed/destroyed. */ stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode, -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25653