From 16d42e06a948baedc7b64502a7b2e05fd1f918c0 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 24 Apr 2018 13:23:12 +0200 Subject: [PATCH 1/1] change permissions before fsync() Reorder the calls so that the metadata changes performed by fchmod() are committed to disk (journal) the same way as the data. --- src/oftmpstream.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/oftmpstream.cpp b/src/oftmpstream.cpp index bf4dda9..71fadd4 100644 --- a/src/oftmpstream.cpp +++ b/src/oftmpstream.cpp @@ -121,8 +121,8 @@ void oftmpstream::close() if (!is_open) return; - fsync(fd); fchmod (fd, file_mode); // fix/change mkstemp permissions + fsync(fd); ::close (fd); if (rename (tmpname.c_str(), realname.c_str()) != 0) -- 1.7.1