Ticket #108: winunlink.patch
File winunlink.patch, 1.1 KB (added by , 18 years ago) |
---|
-
backends/flint/flint_table.cc
23 23 #include <config.h> 24 24 25 25 #include "safeerrno.h" 26 #include "safewindows.h" 26 27 27 28 // Define to use "dangerous" mode - in this mode we write modified btree 28 29 // blocks back in place. This is somewhat faster (especially once we're … … 130 131 131 132 static void sys_unlink(const string &filename) 132 133 { 133 if (unlink(filename) == -1) { 134 while (unlink(filename) == -1) { 135 #if defined __CYGWIN__ || defined __WIN32__ 136 if (errno == EACCES) { 137 138 /* Windows fails with EACCES if the file is currently open for 139 * reading. We need to try again in this case. It would be better 140 * if we could distinguish this from permission denied, so we don't 141 * go into an infinite loop in this situation. */ 142 143 Sleep(100); /* Sleep() takes a number of milliseconds to sleep as 144 it's parameter. */ 145 continue; 146 } 147 #endif 134 148 string message = "Failed to unlink "; 135 149 message += filename; 136 150 message += ": ";