• Ben Gamari's avatar
    EventLog: Loop fwrite if necessary during flush · f46f32b9
    Ben Gamari authored
    Previously the eventlog flush code would fail if `fwrite` wrote less
    than the requested amount. Like all Unix stream I/O operations, however,
    `fwrite` isn't guaranteed to write the entire buffer. Here we loop as
    long as `fwrite` succeeds in writing anything.
    Fixes #11041.
    Test Plan: Validate with eventlog
    Reviewers: austin, simonmar
    Reviewed By: simonmar
    Subscribers: thomie
    Differential Revision: https://phabricator.haskell.org/D1415
    GHC Trac Issues: #11041
EventLog.c 34.1 KB