~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/my_write.cc

  • Committer: Monty Taylor
  • Date: 2010-02-05 08:11:15 UTC
  • mfrom: (1283 build)
  • mto: (1273.13.43 fix_is)
  • mto: This revision was merged to the branch mainline in revision 1300.
  • Revision ID: mordred@inaugust.com-20100205081115-dr82nvrwv4lvw7sd
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
#include "config.h"
17
17
 
18
18
#include "drizzled/internal/my_sys.h"
19
 
#include "drizzled/internal/thread_var.h"
20
 
#include "drizzled/error.h"
21
 
#include <cerrno>
 
19
#include "drizzled/my_error.h"
 
20
#include <errno.h>
22
21
 
23
22
namespace drizzled
24
23
{
48
47
      Count-=writenbytes;
49
48
    }
50
49
    errno=errno;
 
50
#ifndef NO_BACKGROUND
 
51
    if (my_thread_var->abort)
 
52
      MyFlags&= ~ MY_WAIT_IF_FULL;              /* End if aborted by user */
 
53
    if ((errno == ENOSPC || errno == EDQUOT) &&
 
54
        (MyFlags & MY_WAIT_IF_FULL))
 
55
    {
 
56
      if (!(errors++ % MY_WAIT_GIVE_USER_A_MESSAGE))
 
57
        my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH),
 
58
                 "unknown", errno,MY_WAIT_FOR_USER_TO_FIX_PANIC);
 
59
      sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC);
 
60
      continue;
 
61
    }
 
62
 
 
63
    if ((writenbytes == 0 || writenbytes == (size_t) -1))
 
64
    {
 
65
      if (errno == EINTR)
 
66
      {
 
67
        continue;                               /* Interrupted */
 
68
      }
 
69
 
 
70
      if (!writenbytes && !errors++)            /* Retry once */
 
71
      {
 
72
        /* We may come here if the file quota is exeeded */
 
73
        errno=EFBIG;                            /* Assume this is the error */
 
74
        continue;
 
75
      }
 
76
    }
 
77
    else
 
78
      continue;                                 /* Retry */
 
79
#endif
51
80
    if (MyFlags & (MY_NABP | MY_FNABP))
52
81
    {
53
82
      if (MyFlags & (MY_WME | MY_FAE | MY_FNABP))