~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_read.c

  • Committer: Brian Aker
  • Date: 2008-07-18 20:10:26 UTC
  • mfrom: (51.3.29 remove-dbug)
  • Revision ID: brian@tangent.org-20080718201026-tto5golt0xhwqe4a
Merging in Jay's final patch on dbug.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
size_t my_read(File Filedes, uchar *Buffer, size_t Count, myf MyFlags)
37
37
{
38
38
  size_t readbytes, save_count;
39
 
  DBUG_ENTER("my_read");
40
 
  DBUG_PRINT("my",("Fd: %d  Buffer: 0x%lx  Count: %lu  MyFlags: %d",
41
 
                   Filedes, (long) Buffer, (ulong) Count, MyFlags));
42
39
  save_count= Count;
43
40
 
44
41
  for (;;)
47
44
    if ((readbytes= read(Filedes, Buffer, Count)) != Count)
48
45
    {
49
46
      my_errno= errno ? errno : -1;
50
 
      DBUG_PRINT("warning",("Read only %d bytes off %lu from %d, errno: %d",
51
 
                            (int) readbytes, (ulong) Count, Filedes,
52
 
                            my_errno));
53
47
      if ((readbytes == 0 || (int) readbytes == -1) && errno == EINTR)
54
48
      {  
55
 
        DBUG_PRINT("debug", ("my_read() was interrupted and returned %ld",
56
 
                             (long) readbytes));
57
49
        continue;                              /* Interrupted */
58
50
      }
59
51
      if (MyFlags & (MY_WME | MY_FAE | MY_FNABP))
67
59
      }
68
60
      if (readbytes == (size_t) -1 ||
69
61
          ((MyFlags & (MY_FNABP | MY_NABP)) && !(MyFlags & MY_FULL_IO)))
70
 
        DBUG_RETURN(MY_FILE_ERROR);     /* Return with error */
 
62
        return(MY_FILE_ERROR);  /* Return with error */
71
63
      if (readbytes != (size_t) -1 && (MyFlags & MY_FULL_IO))
72
64
      {
73
65
        Buffer+= readbytes;
82
74
      readbytes= save_count;
83
75
    break;
84
76
  }
85
 
  DBUG_RETURN(readbytes);
 
77
  return(readbytes);
86
78
} /* my_read */