summaryrefslogtreecommitdiff
path: root/mysys/my_write.c
diff options
context:
space:
mode:
authortsmith/tim@siva.hindu.god <>2006-09-14 23:20:13 -0600
committertsmith/tim@siva.hindu.god <>2006-09-14 23:20:13 -0600
commit43e8890abc5d48de0bb626081e685770bbbbe8cf (patch)
tree7e5caf8377fbd0f5505ff2bd40395415af23304f /mysys/my_write.c
parent5ec2bfe94c28ad73a691d90b784138f38e9134cd (diff)
parent7b9f4086fa55b1e3414740d0a6e337134794ab05 (diff)
downloadmariadb-git-43e8890abc5d48de0bb626081e685770bbbbe8cf.tar.gz
Merge siva.hindu.god:/usr/home/tim/m/bk/tmp/40
into siva.hindu.god:/usr/home/tim/m/bk/tmp/41
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 4e8369480b3..ae8cb4ab02b 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))