From f6659cac3b764e8a2f4ced7b7058240f06734a20 Mon Sep 17 00:00:00 2001 From: Zheng Bao Date: Thu, 8 Nov 2012 14:21:46 +0800 Subject: [PATCH] nvramtool: fsync for mingw. Change-Id: Ifdec69ca46ba8cbd3eb154d8f4af4b3cafa8019d Signed-off-by: Zheng Bao Signed-off-by: zbao Reviewed-on: http://review.coreboot.org/1805 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- util/nvramtool/cli/nvramtool.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util/nvramtool/cli/nvramtool.c b/util/nvramtool/cli/nvramtool.c index 7716bd8710..76d5cbb678 100644 --- a/util/nvramtool/cli/nvramtool.c +++ b/util/nvramtool/cli/nvramtool.c @@ -45,6 +45,9 @@ #include "reg_expr.h" #include "hexdump.h" #include "cbfs.h" +#ifdef __MINGW32__ +#include +#endif typedef void (*op_fn_t) (void); @@ -168,6 +171,8 @@ int main(int argc, char *argv[]) } #ifndef __MINGW32__ fsync(fd); +#else + FlushFileBuffers ((HANDLE) _get_osfhandle (fd)); #endif }