* shared.c (_wapi_shm_file_open): Break out of a loop if the
shared file is smaller than expected. (We loop a few times in
case another process is in the middle of creating the file.)
svn path=/trunk/mono/; revision=58566
+2006-03-27 Dick Porter <dick@ximian.com>
+
+ * shared.c (_wapi_shm_file_open): Break out of a loop if the
+ shared file is smaller than expected. (We loop a few times in
+ case another process is in the middle of creating the file.)
+
2006-03-22 Dick Porter <dick@ximian.com>
* handles.c:
{
int fd;
struct stat statbuf;
- int ret;
+ int ret, tries = 0;
gboolean created = FALSE;
try_again:
+ if (tries++ > 10) {
+ /* Just give up */
+ return (-1);
+ } else if (tries > 5) {
+ /* Break out of a loop */
+ unlink (filename);
+ }
+
/* No O_CREAT yet, because we need to initialise the file if
* we have to create it.
*/
return(-1);
} else {
/* We didn't create it, so just try opening it again */
+ _wapi_handle_spin (100);
goto try_again;
}
}