summaryrefslogtreecommitdiff
path: root/mysys/my_write.c
diff options
context:
space:
mode:
authormonty@donna.mysql.com <>2001-01-15 17:17:43 +0200
committermonty@donna.mysql.com <>2001-01-15 17:17:43 +0200
commit40494168addbbd1663ad6766429210b2811c0fcd (patch)
tree4264a6499afeab1b99e53f927059e5450643a435 /mysys/my_write.c
parenta7ab29a5392b6feeec5a4b909fef5791fb44d01a (diff)
downloadmariadb-git-40494168addbbd1663ad6766429210b2811c0fcd.tar.gz
Fixed test when exeeding file quota on write
Sanity checks when opening MyISAM files
Diffstat (limited to 'mysys/my_write.c')
-rw-r--r--mysys/my_write.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/mysys/my_write.c b/mysys/my_write.c
index 03cbec4a0d6..61d6c7d2180 100644
--- a/mysys/my_write.c
+++ b/mysys/my_write.c
@@ -41,7 +41,8 @@ uint my_write(int Filedes, const byte *Buffer, uint Count, myf MyFlags)
Count-=writenbytes;
}
my_errno=errno;
- DBUG_PRINT("error",("Write only %d bytes",writenbytes));
+ DBUG_PRINT("error",("Write only %d bytes, error: %d",
+ writenbytes,my_errno));
#ifndef NO_BACKGROUND
#ifdef THREAD
if (my_thread_var->abort)
@@ -56,8 +57,18 @@ uint my_write(int Filedes, const byte *Buffer, uint Count, myf MyFlags)
VOID(sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC));
continue;
}
- if ((writenbytes == 0 && my_errno == EINTR) ||
- (writenbytes > 0 && (uint) writenbytes != (uint) -1))
+ if (!writenbytes)
+ {
+ /* We may come here on an interrupt or if the file quote is exeeded */
+ if (my_errno == EINTR)
+ continue;
+ if (!errors++) /* Retry once */
+ {
+ errno=EFBIG; /* Assume this is the error */
+ continue;
+ }
+ }
+ else if ((uint) writenbytes != (uint) -1)
continue; /* Retry */
#endif
if (MyFlags & (MY_NABP | MY_FNABP))