~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_seek.c

  • Committer: Jay Pipes
  • Date: 2008-07-17 20:13:32 UTC
  • mto: This revision was merged to the branch mainline in revision 182.
  • Revision ID: jay@mysql.com-20080717201332-utj9dwtsd6vcq1kx
Phase 4 removal of DBUG in mysys

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
                 myf MyFlags __attribute__((unused)))
47
47
{
48
48
  register os_off_t newpos= -1;
49
 
  DBUG_ENTER("my_seek");
50
 
  DBUG_PRINT("my",("Fd: %d  Hpos: %lu  Pos: %lu  Whence: %d  MyFlags: %d",
51
 
                   fd, (ulong) (((uint64_t) pos) >> 32), (ulong) pos, 
52
 
                   whence, MyFlags));
53
 
  DBUG_ASSERT(pos != MY_FILEPOS_ERROR);         /* safety check */
 
49
  assert(pos != MY_FILEPOS_ERROR);              /* safety check */
54
50
 
55
51
  /*
56
52
      Make sure we are using a valid file descriptor!
57
53
  */
58
 
  DBUG_ASSERT(fd != -1);
 
54
  assert(fd != -1);
59
55
#if !defined(HAVE_PREAD)
60
56
  if (MyFlags & MY_THREADSAFE)
61
57
  {
69
65
  if (newpos == (os_off_t) -1)
70
66
  {
71
67
    my_errno=errno;
72
 
    DBUG_PRINT("error",("lseek: %lu  errno: %d", (ulong) newpos,errno));
73
 
    DBUG_RETURN(MY_FILEPOS_ERROR);
74
 
  }
75
 
  if ((my_off_t) newpos != pos)
76
 
  {
77
 
    DBUG_PRINT("exit",("pos: %lu", (ulong) newpos));
78
 
  }
79
 
  DBUG_RETURN((my_off_t) newpos);
 
68
    return(MY_FILEPOS_ERROR);
 
69
  }
 
70
  return((my_off_t) newpos);
80
71
} /* my_seek */
81
72
 
82
73
 
86
77
my_off_t my_tell(File fd, myf MyFlags __attribute__((unused)))
87
78
{
88
79
  os_off_t pos;
89
 
  DBUG_ENTER("my_tell");
90
 
  DBUG_PRINT("my",("Fd: %d  MyFlags: %d",fd, MyFlags));
91
 
  DBUG_ASSERT(fd >= 0);
 
80
  assert(fd >= 0);
92
81
#ifdef HAVE_TELL
93
82
  pos=tell(fd);
94
83
#else
96
85
#endif
97
86
  if (pos == (os_off_t) -1)
98
87
    my_errno=errno;
99
 
  DBUG_PRINT("exit",("pos: %lu", (ulong) pos));
100
 
  DBUG_RETURN((my_off_t) pos);
 
88
  return((my_off_t) pos);
101
89
} /* my_tell */