summaryrefslogtreecommitdiff
path: root/mysys/my_write.c
diff options
context:
space:
mode:
authorunknown <tsmith/tim@siva.hindu.god>2006-09-14 23:20:13 -0600
committerunknown <tsmith/tim@siva.hindu.god>2006-09-14 23:20:13 -0600
commitac1a030e34aa4ca29cd93679541e2f9fbeb83382 (patch)
tree7e5caf8377fbd0f5505ff2bd40395415af23304f /mysys/my_write.c
parentda5e2660b7ecea8b255f8b7e4f69c61d157918d7 (diff)
parentd7a1f97c15fc5adaaf3116b8fb9ee32783498165 (diff)
downloadmariadb-git-ac1a030e34aa4ca29cd93679541e2f9fbeb83382.tar.gz
Merge siva.hindu.god:/usr/home/tim/m/bk/tmp/40
into siva.hindu.god:/usr/home/tim/m/bk/tmp/41 mysys/my_lwrite.c: Auto merged mysys/my_pread.c: Auto merged mysys/my_read.c: Auto merged mysys/my_write.c: Auto merged
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))