X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=c259cc56e436a6327326be170c11e9a5d2d52a84;hb=8778e777cf7414b29c3fda5914039d49b619daed;hp=64b5f3d416eae17cf604e3c293a49228c1e49586;hpb=4103b43cdbc7412da6a2a95e0e1882a3872a2d12;p=xboard.git diff --git a/backend.c b/backend.c index 64b5f3d..c259cc5 100644 --- a/backend.c +++ b/backend.c @@ -11955,12 +11955,18 @@ SaveGameToFile(filename, append) { FILE *f; char buf[MSG_SIZ]; - int result; + int result, i, t,tot=0; if (strcmp(filename, "-") == 0) { return SaveGame(stdout, 0, NULL); } else { - f = fopen(filename, append ? "a" : "w"); + for(i=0; i<10; i++) { // upto 10 tries + f = fopen(filename, append ? "a" : "w"); + if(f && i) fprintf(f, "[Delay \"%d retries, %d msec\"]\n",i,tot); + if(f || errno != 13) break; + DoSleep(t = 5 + random()%11); // wait 5-15 msec + tot += t; + } if (f == NULL) { snprintf(buf, sizeof(buf), _("Can't open \"%s\""), filename); DisplayError(buf, errno);