* mmap.cc (handler_disk_file::msync): Add call to FlushFileBuffers
to implement MS_SYNC.
This commit is contained in:
		| @@ -1,3 +1,8 @@ | |||||||
|  | 2013-01-18  Christopher Faylor  <me.cygwin2013@cgf.cx> | ||||||
|  |  | ||||||
|  | 	* mmap.cc (handler_disk_file::msync): Add call to FlushFileBuffers | ||||||
|  | 	to implement MS_SYNC. | ||||||
|  |  | ||||||
| 2013-01-17  Christopher Faylor  <me.cygwin2013@cgf.cx> | 2013-01-17  Christopher Faylor  <me.cygwin2013@cgf.cx> | ||||||
|  |  | ||||||
| 	* mmap.cc (handler_disk_file::msync): Retry up to 99 times if | 	* mmap.cc (handler_disk_file::msync): Retry up to 99 times if | ||||||
|   | |||||||
| @@ -1664,7 +1664,14 @@ fhandler_disk_file::msync (HANDLE h, caddr_t addr, size_t len, int flags) | |||||||
|      cygwin list.  So retry 99 times and hope we get lucky.  */ |      cygwin list.  So retry 99 times and hope we get lucky.  */ | ||||||
|   for (int i = 0; i < retry; i++) |   for (int i = 0; i < retry; i++) | ||||||
|     if (FlushViewOfFile (addr, len)) |     if (FlushViewOfFile (addr, len)) | ||||||
|       return 0; |       { | ||||||
|  | 	/* FlushViewOfFile just triggers the action and returns immediately, | ||||||
|  | 	   so it's equivalent to MS_ASYNC.  MS_SYNC requires another call to | ||||||
|  | 	   FlushFileBuffers. */ | ||||||
|  | 	if (flags & MS_SYNC) | ||||||
|  | 	  FlushFileBuffers (h); | ||||||
|  | 	return 0; | ||||||
|  |       } | ||||||
|     else if (GetLastError () != ERROR_LOCK_VIOLATION) |     else if (GetLastError () != ERROR_LOCK_VIOLATION) | ||||||
|       break; |       break; | ||||||
|     else if (i < (retry - 1)) |     else if (i < (retry - 1)) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user