[PATCH] Test fclose on an unopened file.

Aaron Merey amerey@redhat.com
Thu Sep 5 14:00:40 GMT 2024


Hi Florian,

On Thu, Sep 5, 2024 at 7:58 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> Sorry, missed that you can use
>
>   TEST_COMPARE (fclose (stdin), 0);
>   TEST_COMPARE (fclose (stdin), EOF);
>
> It will provide additional diagnostics on failure.
>
> We should also add a second test with an
> libio/tst-fclose-unopened2.input file: read something from it, and then
> do the same double fclose.  This will cover the case where a buffer has
> been allocated.  We can do this in a separate patch if you prefer.

Ok I will add this in a separate patch.

> Do you have commit access to the glibc project, or should I push the
> revised version (with TEST_COMPARE) on your behalf?

Please push the revised version. I don't have commit access but I will
request it.

Aaron



More information about the Libc-alpha mailing list