~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/my_write.cc

  • Committer: Mark Atwood
  • Date: 2011-08-11 03:05:03 UTC
  • mfrom: (2385.1.12 refactor4)
  • Revision ID: me@mark.atwood.name-20110811030503-rp9xjihc5x3y0x4q
mergeĀ lp:~olafvdspek/drizzle/refactor4

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
   along with this program; if not, write to the Free Software
14
14
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
15
15
 
16
 
#include "config.h"
 
16
#include <config.h>
17
17
 
18
 
#include "drizzled/internal/my_sys.h"
19
 
#include "drizzled/internal/thread_var.h"
20
 
#include "drizzled/error.h"
 
18
#include <drizzled/internal/my_sys.h>
 
19
#include <drizzled/internal/thread_var.h>
 
20
#include <drizzled/error.h>
21
21
#include <cerrno>
22
22
 
23
23
namespace drizzled
30
30
size_t my_write(int Filedes, const unsigned char *Buffer, size_t Count, myf MyFlags)
31
31
{
32
32
  size_t writenbytes, written;
33
 
  uint32_t errors;
34
 
  errors=0; written=0;
 
33
  written=0;
35
34
 
36
35
  /* The behavior of write(fd, buf, 0) is not portable */
37
36
  if (unlikely(!Count))
38
 
    return(0);
 
37
    return 0;
39
38
 
40
39
  for (;;)
41
40
  {
61
60
      break;                                    /* Return bytes written */
62
61
  }
63
62
  if (MyFlags & (MY_NABP | MY_FNABP))
64
 
    return(0);                  /* Want only errors */
 
63
    return 0;                   /* Want only errors */
65
64
  return(writenbytes+written);
66
65
} /* my_write */
67
66