1 parent fae7b81 commit 8fc3bacCopy full SHA for 8fc3bac
1 file changed
src/node_file.cc
@@ -437,6 +437,8 @@ static Handle<Value> Fdatasync(const Arguments& args) {
437
} else {
438
#if HAVE_FDATASYNC
439
int ret = fdatasync(fd);
440
+#elif defined(__MINGW32__)
441
+ int ret = FlushFileBuffers((HANDLE)_get_osfhandle(fd)) ? 0 : -1;
442
#else
443
int ret = fsync(fd);
444
#endif
@@ -457,7 +459,11 @@ static Handle<Value> Fsync(const Arguments& args) {
457
459
if (args[1]->IsFunction()) {
458
460
ASYNC_CALL(fsync, args[1], fd)
461
462
+#ifdef __MINGW32__
463
464
+#else
465
466
+#endif
467
if (ret != 0) return ThrowException(ErrnoException(errno));
468
return Undefined();
469
}
0 commit comments