lfs_filebd_sync: fix compilation on Windows

This commit is contained in:
Mikhail Paulyshka
2022-07-27 17:06:51 +03:00
committed by GitHub
parent 40dba4a556
commit a405c3293f
+1 -1
View File
@@ -204,7 +204,7 @@ int lfs_filebd_sync(const struct lfs_config *cfg) {
// file sync // file sync
lfs_filebd_t *bd = cfg->context; lfs_filebd_t *bd = cfg->context;
#ifdef _WIN32 #ifdef _WIN32
int err = FlushFileBuffers((HANDLE) _get_osfhandle(fd)) ? 0 : -1; int err = FlushFileBuffers((HANDLE) _get_osfhandle(bd->fd)) ? 0 : -1;
#else #else
int err = fsync(bd->fd); int err = fsync(bd->fd);
#endif #endif