~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_sync.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:
43
43
int my_sync(File fd, myf my_flags)
44
44
{
45
45
  int res;
46
 
  DBUG_ENTER("my_sync");
47
 
  DBUG_PRINT("my",("Fd: %d  my_flags: %d", fd, my_flags));
48
46
 
49
47
  do
50
48
  {
56
54
    if (!(res= fcntl(fd, F_FULLFSYNC, 0)))
57
55
      break; /* ok */
58
56
    /* Some file systems don't support F_FULLFSYNC and fail above: */
59
 
    DBUG_PRINT("info",("fcntl(F_FULLFSYNC) failed, falling back"));
60
57
#endif
61
58
#if defined(HAVE_FDATASYNC)
62
59
    res= fdatasync(fd);
76
73
    if ((my_flags & MY_IGNORE_BADFD) &&
77
74
        (er == EBADF || er == EINVAL || er == EROFS))
78
75
    {
79
 
      DBUG_PRINT("info", ("ignoring errno %d", er));
80
76
      res= 0;
81
77
    }
82
78
    else if (my_flags & MY_WME)
83
79
      my_error(EE_SYNC, MYF(ME_BELL+ME_WAITTANG), my_filename(fd), my_errno);
84
80
  }
85
 
  DBUG_RETURN(res);
 
81
  return(res);
86
82
} /* my_sync */
87
83
 
88
84
 
101
97
int my_sync_dir(const char *dir_name, myf my_flags)
102
98
{
103
99
#ifdef NEED_EXPLICIT_SYNC_DIR
104
 
  DBUG_ENTER("my_sync_dir");
105
 
  DBUG_PRINT("my",("Dir: '%s'  my_flags: %d", dir_name, my_flags));
106
100
  File dir_fd;
107
101
  int res= 0;
108
102
  const char *correct_dir_name;
121
115
  }
122
116
  else
123
117
    res= 1;
124
 
  DBUG_RETURN(res);
 
118
  return(res);
125
119
#else
126
120
  return 0;
127
121
#endif