Skip to content
Snippets Groups Projects
  • Colin Walters's avatar
    371172bc
    fdio: Fix errno handling from posix_fallocate() and loop_write() · 371172bc
    Colin Walters authored
    For extra fun, both of these functions have different error handling
    schemes.  `posix_fallocate` does *not* set `errno` because...  I'm not
    sure.  Maybe POSIX was trying a new function design?
    
    `loop_write` uses the systemd error handling style which returns
    `-errno`, so we need to set errno back so that the macro can propagate
    it into the `GError`.
    371172bc
    History
    fdio: Fix errno handling from posix_fallocate() and loop_write()
    Colin Walters authored
    For extra fun, both of these functions have different error handling
    schemes.  `posix_fallocate` does *not* set `errno` because...  I'm not
    sure.  Maybe POSIX was trying a new function design?
    
    `loop_write` uses the systemd error handling style which returns
    `-errno`, so we need to set errno back so that the macro can propagate
    it into the `GError`.