aboutsummaryrefslogtreecommitdiff
path: root/win32/mingw.c
diff options
context:
space:
mode:
Diffstat (limited to 'win32/mingw.c')
-rw-r--r--win32/mingw.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/win32/mingw.c b/win32/mingw.c
index 3183cd78e..a65a0a6d1 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -1666,6 +1666,29 @@ int mingw_rmdir(const char *path)
1666 return rmdir(path); 1666 return rmdir(path);
1667} 1667}
1668 1668
1669void mingw_sync(void)
1670{
1671 HANDLE h;
1672 FILE *mnt;
1673 struct mntent *entry;
1674 char name[] = "\\\\.\\C:";
1675
1676 mnt = setmntent(bb_path_mtab_file, "r");
1677 if (mnt) {
1678 while ((entry=getmntent(mnt)) != NULL) {
1679 name[4] = entry->mnt_dir[0];
1680 h = CreateFile(name, GENERIC_READ | GENERIC_WRITE,
1681 FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
1682 OPEN_EXISTING, 0, NULL);
1683 if (h != INVALID_HANDLE_VALUE) {
1684 FlushFileBuffers(h);
1685 CloseHandle(h);
1686 }
1687 }
1688 endmntent(mnt);
1689 }
1690}
1691
1669#define NUMEXT 5 1692#define NUMEXT 5
1670static const char win_suffix[NUMEXT][4] = { "sh", "com", "exe", "bat", "cmd" }; 1693static const char win_suffix[NUMEXT][4] = { "sh", "com", "exe", "bat", "cmd" };
1671 1694