~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_write.cc

  • Committer: Monty Taylor
  • Date: 2009-12-23 08:01:21 UTC
  • mto: This revision was merged to the branch mainline in revision 1253.
  • Revision ID: mordred@inaugust.com-20091223080121-iveugdrewkp7iqyi
Oy. Bigger change than I normally like - but this stuff is all intertwined.
Moved a bunch of things to public drizzled/ area. Split some files. Made some
convenience libs. EVENTUALLY, some of this will be able to be re-factored, but
for now I'm ok with erring on the side of too many files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
#include "mysys/mysys_priv.h"
17
 
#include "mysys/mysys_err.h"
 
17
#include "drizzled/my_error.h"
18
18
#include <errno.h>
19
19
 
20
20
 
40
40
      Buffer+=writenbytes;
41
41
      Count-=writenbytes;
42
42
    }
43
 
    my_errno=errno;
 
43
    errno=errno;
44
44
#ifndef NO_BACKGROUND
45
45
    if (my_thread_var->abort)
46
46
      MyFlags&= ~ MY_WAIT_IF_FULL;              /* End if aborted by user */
47
 
    if ((my_errno == ENOSPC || my_errno == EDQUOT) &&
 
47
    if ((errno == ENOSPC || errno == EDQUOT) &&
48
48
        (MyFlags & MY_WAIT_IF_FULL))
49
49
    {
50
50
      if (!(errors++ % MY_WAIT_GIVE_USER_A_MESSAGE))
51
51
        my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH),
52
 
                 "unknown", my_errno,MY_WAIT_FOR_USER_TO_FIX_PANIC);
 
52
                 "unknown", errno,MY_WAIT_FOR_USER_TO_FIX_PANIC);
53
53
      sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC);
54
54
      continue;
55
55
    }
56
56
 
57
57
    if ((writenbytes == 0 || writenbytes == (size_t) -1))
58
58
    {
59
 
      if (my_errno == EINTR)
 
59
      if (errno == EINTR)
60
60
      {
61
61
        continue;                               /* Interrupted */
62
62
      }
76
76
      if (MyFlags & (MY_WME | MY_FAE | MY_FNABP))
77
77
      {
78
78
        my_error(EE_WRITE, MYF(ME_BELL+ME_WAITTANG),
79
 
                 "unknown", my_errno);
 
79
                 "unknown", errno);
80
80
      }
81
81
      return(MY_FILE_ERROR);            /* Error on read */
82
82
    }