diff options
author | Daniel Bertalan <dani@danielbertalan.dev> | 2022-01-15 14:41:39 +0100 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2022-01-16 14:59:21 -0800 |
commit | a1dfa1efb2da5b79683e8cc00706d12e0fe1bcf7 (patch) | |
tree | 60389cf27b150e196e4b39d4712d34ad3cadbb59 /Documentation/NetworkBoot.md | |
parent | 6a6dbf5b0b23ce59ae4462f9aef93434f94f0226 (diff) | |
download | serenity-a1dfa1efb2da5b79683e8cc00706d12e0fe1bcf7.zip |
LibC: Flush all file streams on exit
The POSIX standard specifies the following:
> If the main() function returns to its original caller, or if the
> exit() function is called, all open files are closed (hence all output
> streams are flushed) before program termination.
This means that flushing `stdin` and `stdout` only is not enough, as the
program might have pending writes in other file buffers too.
Now that we support `fflush(nullptr)`, we call that in `exit()` to flush
all streams. This fixes one of bash's generated headers not being
written to disk.
Diffstat (limited to 'Documentation/NetworkBoot.md')
0 files changed, 0 insertions, 0 deletions