Skip to content
Snippets Groups Projects
  • Colin Walters's avatar
    d2e588d9
    fdio: Add unlinkat() in error paths for tmpfiles · d2e588d9
    Colin Walters authored
    This is kind of an ABI change but it's for the better I think; on
    error we consistently clean up the temp file.
    
    This is obviously necessary without `O_TMPFILE`.  With it, we still
    need an error cleanup in the case where we're trying to replace an
    existing file.  I noticed this in ostree's `tests/test-refs.sh` which
    intentionally tries to rename a file over a directory path.
    d2e588d9
    History
    fdio: Add unlinkat() in error paths for tmpfiles
    Colin Walters authored
    This is kind of an ABI change but it's for the better I think; on
    error we consistently clean up the temp file.
    
    This is obviously necessary without `O_TMPFILE`.  With it, we still
    need an error cleanup in the case where we're trying to replace an
    existing file.  I noticed this in ostree's `tests/test-refs.sh` which
    intentionally tries to rename a file over a directory path.