summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ImageMetaData.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ImageMetaData.cxx b/src/ImageMetaData.cxx
index a4e7174..7cedcf2 100644
--- a/src/ImageMetaData.cxx
+++ b/src/ImageMetaData.cxx
@@ -258,7 +258,10 @@ ImageMetaData::save_image_jpgcom(char *in_img, char *out_img) {
err++;
}
+#ifdef HAVE_FSYNC
fsync(tmp_fd); // make sure data is on disk before replacing orig file
+#endif
+
close(tmp_fd);
if (err == 0) { // only overwrite existing image if everything was ok