~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/my_write.cc

  • Committer: Brian Aker
  • Date: 2010-05-28 01:36:09 UTC
  • Revision ID: brian@gaz-20100528013609-lvsd6znyufrpmddk
Rollup patch for hiding tableshare.

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 */
15
 
 
16
 
#include <config.h>
17
 
 
18
 
#include <drizzled/internal/my_sys.h>
19
 
#include <drizzled/internal/thread_var.h>
20
 
#include <drizzled/error.h>
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
#include "config.h"
 
17
 
 
18
#include "drizzled/internal/my_sys.h"
 
19
#include "drizzled/error.h"
21
20
#include <cerrno>
22
21
 
23
22
namespace drizzled
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))