summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-04-07 18:51:30 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-04-07 18:51:30 +0200
commite9608cf2e589c019cd602cea6e9c9f201df36a71 (patch)
tree947d1648d44ab788c665c881e6b8d8fdc4343bb8 /src
parent493e43b486a94c55e5edeaeba0d79f4ab4484694 (diff)
check for fsync() availability
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