~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_quick.c

  • Committer: Brian Aker
  • Date: 2008-07-07 14:25:25 UTC
  • mto: (77.1.25 codestyle)
  • mto: This revision was merged to the branch mainline in revision 82.
  • Revision ID: brian@tangent.org-20080707142525-xzy2nl3ie2ebwfln
LL() cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include "my_nosys.h"
20
20
 
21
21
 
22
 
size_t my_quick_read(File Filedes,unsigned char *Buffer,size_t Count,myf MyFlags)
 
22
size_t my_quick_read(File Filedes,uchar *Buffer,size_t Count,myf MyFlags)
23
23
{
24
24
  size_t readbytes;
25
25
 
26
26
  if ((readbytes = read(Filedes, Buffer, Count)) != Count)
27
27
  {
 
28
#ifndef DBUG_OFF
 
29
    if ((readbytes == 0 || readbytes == (size_t) -1) && errno == EINTR)
 
30
    {  
 
31
      DBUG_PRINT("error", ("my_quick_read() was interrupted and returned %d"
 
32
                           ".  This function does not retry the read!",
 
33
                           (int) readbytes));
 
34
    }
 
35
#endif
28
36
    my_errno=errno;
29
37
    return readbytes;
30
38
  }
32
40
}
33
41
 
34
42
 
35
 
size_t my_quick_write(File Filedes,const unsigned char *Buffer,size_t Count)
 
43
size_t my_quick_write(File Filedes,const uchar *Buffer,size_t Count)
36
44
{
 
45
#ifndef DBUG_OFF
 
46
  size_t writtenbytes;
 
47
#endif
 
48
 
37
49
  if ((
 
50
#ifndef DBUG_OFF
 
51
       writtenbytes =
 
52
#endif
38
53
       (size_t) write(Filedes,Buffer,Count)) != Count)
39
54
  {
 
55
#ifndef DBUG_OFF
 
56
    if ((writtenbytes == 0 || writtenbytes == (size_t) -1) && errno == EINTR)
 
57
    {  
 
58
      DBUG_PRINT("error", ("my_quick_write() was interrupted and returned %d"
 
59
                           ".  This function does not retry the write!",
 
60
                           (int) writtenbytes));
 
61
    }
 
62
#endif
40
63
    my_errno=errno;
41
64
    return (size_t) -1;
42
65
  }