Merge branch 'fsync-shadow-files-before-rename' of https://github.com/awelzel/zeek

* 'fsync-shadow-files-before-rename' of https://github.com/awelzel/zeek:
  logging/writers/ascii: shadow files: Add fsync() before rename()
This commit is contained in:
Johanna Amann 2021-10-15 09:21:42 +01:00
commit 1b3b9a3cfc
5 changed files with 45 additions and 3 deletions

View file

@ -461,6 +461,10 @@ extern bool safe_write(int fd, const char* data, int len);
// Same as safe_write(), but for pwrite().
extern bool safe_pwrite(int fd, const unsigned char* data, size_t len, size_t offset);
// Like fsync() but handles interrupted system calls by retrying and
// aborts on unrecoverable errors.
extern bool safe_fsync(int fd);
// Wraps close(2) to emit error messages and abort on unrecoverable errors.
extern void safe_close(int fd);