~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_write.c

  • Committer: Jay Pipes
  • Date: 2008-07-17 20:11:46 UTC
  • mto: This revision was merged to the branch mainline in revision 182.
  • Revision ID: jay@mysql.com-20080717201146-s2flcwwq0q89ac1y
Phase 3 removal of DBUG in mysys

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
{
25
25
  size_t writenbytes, written;
26
26
  uint errors;
27
 
  DBUG_ENTER("my_write");
28
 
  DBUG_PRINT("my",("Fd: %d  Buffer: 0x%lx  Count: %lu  MyFlags: %d",
29
 
                   Filedes, (long) Buffer, (ulong) Count, MyFlags));
30
27
  errors=0; written=0;
31
28
 
32
29
  /* The behavior of write(fd, buf, 0) is not portable */
33
30
  if (unlikely(!Count))
34
 
    DBUG_RETURN(0);
 
31
    return(0);
35
32
  
36
33
  for (;;)
37
34
  {
44
41
      Count-=writenbytes;
45
42
    }
46
43
    my_errno=errno;
47
 
    DBUG_PRINT("error",("Write only %ld bytes, error: %d",
48
 
                        (long) writenbytes, my_errno));
49
44
#ifndef NO_BACKGROUND
50
45
    if (my_thread_var->abort)
51
46
      MyFlags&= ~ MY_WAIT_IF_FULL;              /* End if aborted by user */
63
58
    {
64
59
      if (my_errno == EINTR)
65
60
      {
66
 
        DBUG_PRINT("debug", ("my_write() was interrupted and returned %ld",
67
 
                             (long) writenbytes));
68
61
        continue;                               /* Interrupted */
69
62
      }
70
63
 
85
78
        my_error(EE_WRITE, MYF(ME_BELL+ME_WAITTANG),
86
79
                 my_filename(Filedes),my_errno);
87
80
      }
88
 
      DBUG_RETURN(MY_FILE_ERROR);               /* Error on read */
 
81
      return(MY_FILE_ERROR);            /* Error on read */
89
82
    }
90
83
    else
91
84
      break;                                    /* Return bytes written */
92
85
  }
93
86
  if (MyFlags & (MY_NABP | MY_FNABP))
94
 
    DBUG_RETURN(0);                     /* Want only errors */
95
 
  DBUG_RETURN(writenbytes+written);
 
87
    return(0);                  /* Want only errors */
 
88
  return(writenbytes+written);
96
89
} /* my_write */