Skip to content

freopen with NULL filepath fails #2470

Closed
@aamcampbell

Description

@aamcampbell

According to the C standard for freopen() (as stated in POSIX),

"If filename is a null pointer, the freopen() function shall attempt to change the mode of the stream to that specified by mode, as if the name of the file currently associated with the stream had been used."
(http://pubs.opengroup.org/onlinepubs/009695399/functions/freopen.html)

However, when I call freopen(NULL, "mode", pFile) in ARM mbed, it fails and returns NULL. The call fails whether or not the mode is the same as pFile was originally opened with.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions