~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_lib.c

  • Committer: Monty Taylor
  • Date: 2008-07-02 14:35:48 UTC
  • mto: This revision was merged to the branch mainline in revision 51.
  • Revision ID: monty@inaugust.com-20080702143548-onj30ry0sugr01uw
Removed all references to THREAD.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
# endif
38
38
#endif
39
39
 
40
 
#if defined(THREAD) && defined(HAVE_READDIR_R)
 
40
#if defined(HAVE_READDIR_R)
41
41
#define READDIR(A,B,C) ((errno=readdir_r(A,B,&C)) != 0 || !C)
42
42
#else
43
43
#define READDIR(A,B,C) (!(C=readdir(A)))
91
91
  DIR           *dirp;
92
92
  struct dirent *dp;
93
93
  char          tmp_path[FN_REFLEN+1],*tmp_file;
94
 
#ifdef THREAD
95
94
  char  dirent_tmp[sizeof(struct dirent)+_POSIX_PATH_MAX+1];
96
 
#endif
97
95
  DBUG_ENTER("my_dir");
98
96
  DBUG_PRINT("my",("path: '%s' MyFlags: %d",path,MyFlags));
99
97
 
100
 
#if defined(THREAD) && !defined(HAVE_READDIR_R)
 
98
#if !defined(HAVE_READDIR_R)
101
99
  pthread_mutex_lock(&THR_LOCK_open);
102
100
#endif
103
101
 
125
123
 
126
124
  tmp_file=strend(tmp_path);
127
125
 
128
 
#ifdef THREAD
129
126
  dp= (struct dirent*) dirent_tmp;
130
 
#else
131
 
  dp=0;
132
 
#endif
133
127
  
134
128
  while (!(READDIR(dirp,(struct dirent*) dirent_tmp,dp)))
135
129
  {
156
150
  }
157
151
 
158
152
  (void) closedir(dirp);
159
 
#if defined(THREAD) && !defined(HAVE_READDIR_R)
 
153
#if !defined(HAVE_READDIR_R)
160
154
  pthread_mutex_unlock(&THR_LOCK_open);
161
155
#endif
162
156
  result->dir_entry= (FILEINFO *)dir_entries_storage->buffer;
168
162
  DBUG_RETURN(result);
169
163
 
170
164
 error:
171
 
#if defined(THREAD) && !defined(HAVE_READDIR_R)
 
165
#if !defined(HAVE_READDIR_R)
172
166
  pthread_mutex_unlock(&THR_LOCK_open);
173
167
#endif
174
168
  my_errno=errno;