nvramtool: fsync for mingw.

Change-Id: Ifdec69ca46ba8cbd3eb154d8f4af4b3cafa8019d
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: zbao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1805
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
This commit is contained in:
Zheng Bao 2012-11-08 14:21:46 +08:00 committed by Patrick Georgi
parent 431a816019
commit f6659cac3b
1 changed files with 5 additions and 0 deletions

View File

@ -45,6 +45,9 @@
#include "reg_expr.h"
#include "hexdump.h"
#include "cbfs.h"
#ifdef __MINGW32__
#include <windows.h>
#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
}