~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_sync.c

  • Committer: Monty Taylor
  • Date: 2008-10-16 06:32:30 UTC
  • mto: (511.1.5 codestyle)
  • mto: This revision was merged to the branch mainline in revision 521.
  • Revision ID: monty@inaugust.com-20081016063230-4brxsra0qsmsg84q
Added -Wunused-macros.

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
 
98
94
  RETURN
99
95
    0 if ok, !=0 if error
100
96
*/
101
 
int my_sync_dir(const char *dir_name, myf my_flags)
 
97
int my_sync_dir(const char *dir_name __attribute__((unused)),
 
98
                myf my_flags __attribute__((unused)))
102
99
{
103
100
#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
101
  File dir_fd;
107
102
  int res= 0;
108
103
  const char *correct_dir_name;
121
116
  }
122
117
  else
123
118
    res= 1;
124
 
  DBUG_RETURN(res);
 
119
  return(res);
125
120
#else
126
121
  return 0;
127
122
#endif
139
134
  RETURN
140
135
    0 if ok, !=0 if error
141
136
*/
142
 
int my_sync_dir_by_file(const char *file_name, myf my_flags)
 
137
int my_sync_dir_by_file(const char *file_name __attribute__((unused)),
 
138
                        myf my_flags __attribute__((unused)))
143
139
{
144
140
#ifdef NEED_EXPLICIT_SYNC_DIR
145
141
  char dir_name[FN_REFLEN];