swaroop: put fsync in the right place.
authorCarl Hetherington <cth@carlh.net>
Thu, 14 Feb 2019 15:25:14 +0000 (15:25 +0000)
committerCarl Hetherington <cth@carlh.net>
Thu, 14 Feb 2019 15:25:14 +0000 (15:25 +0000)
src/wx/swaroop_controls.cc

index b2b1a2bdaef79039b4c1ddd213e98bd1e7341df7..abf6fc58c87d1be095ed0b683a1ba0252c809cf6 100644 (file)
@@ -144,9 +144,6 @@ SwaroopControls::check_restart ()
                }
        }
 
-#ifdef DCPOMATIC_LINUX
-       fsync (fileno(f));
-#endif
        fclose (f);
 }
 
@@ -164,6 +161,9 @@ SwaroopControls::viewer_position_changed ()
                        + " " + dcp::raw_convert<string>(_viewer->position().get());
 
                checked_fwrite (p.c_str(), p.length(), f, Config::path("position"));
+#ifdef DCPOMATIC_LINUX
+               fsync (fileno(f));
+#endif
                fclose (f);
        }
 }