summaryrefslogtreecommitdiff
path: root/mysys/my_write.c
diff options
context:
space:
mode:
authortsmith/tim@siva.hindu.god <>2006-09-14 23:19:24 -0600
committertsmith/tim@siva.hindu.god <>2006-09-14 23:19:24 -0600
commit7b9f4086fa55b1e3414740d0a6e337134794ab05 (patch)
treedd6fccf50a67ceee15c758d3bd103902956a4058 /mysys/my_write.c
parent8ea01fbca805a48f6d69d5022fe885359c294fd2 (diff)
downloadmariadb-git-7b9f4086fa55b1e3414740d0a6e337134794ab05.tar.gz
Bug #4053: too many of "error 1236: 'binlog truncated in the middle of event' from master"
- Fix my_read/my_write to handle return values from read/write correctly - Add debugging 'deprecated function' warning to my_lread/my_lwrite - Add debugging 'error, read/write interrupt not handled' warning to my_quick_read/my_quick_write There is no test case associated with these changes. However, this is a conservative change, and no repeatable test case is available.
Diffstat (limited to 'mysys/my_write.c')
-rw-r--r--mysys/my_write.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/mysys/my_write.c b/mysys/my_write.c
index 1d1a893090a..de762c16a07 100644
--- a/mysys/my_write.c
+++ b/mysys/my_write.c
@@ -57,18 +57,24 @@ uint my_write(int Filedes, const byte *Buffer, uint Count, myf MyFlags)
VOID(sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC));
continue;
}
- if (!writenbytes)
+
+ if ((writenbytes == 0 || (int) writenbytes == -1))
{
- /* 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;
+ DBUG_PRINT("debug", ("my_write() was interrupted and returned %d",
+ (int) writenbytes));
+ continue; /* Interrupted */
+ }
+
+ if (!writenbytes && !errors++) /* Retry once */
+ {
+ /* We may come here if the file quota is exeeded */
+ errno=EFBIG; /* Assume this is the error */
+ continue;
}
}
- else if ((uint) writenbytes != (uint) -1)
+ else
continue; /* Retry */
#endif
if (MyFlags & (MY_NABP | MY_FNABP))