~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_panic.cc

  • Committer: Eric Day
  • Date: 2009-03-27 20:35:31 UTC
  • mto: (968.1.1 lib-merge)
  • mto: This revision was merged to the branch mainline in revision 969.
  • Revision ID: eday@oddments.org-20090327203531-4am4v2x42eylezmq
Fixes for Solaris build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
#include "myisamdef.h"
17
17
 
18
 
using namespace std;
19
 
 
20
18
        /* if flag == HA_PANIC_CLOSE then all misam files are closed */
21
19
        /* if flag == HA_PANIC_WRITE then all misam files are unlocked and
22
20
           all changed data in single user misam is written to file */
28
26
int mi_panic(enum ha_panic_function flag)
29
27
{
30
28
  int error=0;
 
29
  LIST *list_element,*next_open;
31
30
  MI_INFO *info;
32
31
 
33
32
  pthread_mutex_lock(&THR_LOCK_myisam);
34
 
  list<MI_INFO *>::iterator it= myisam_open_list.begin();
35
 
  while (it != myisam_open_list.end())
 
33
  for (list_element=myisam_open_list ; list_element ; list_element=next_open)
36
34
  {
37
 
    info= *it;
 
35
    next_open=list_element->next;               /* Save if close */
 
36
    info=(MI_INFO*) list_element->data;
38
37
    switch (flag) {
39
38
    case HA_PANIC_CLOSE:
40
39
      pthread_mutex_unlock(&THR_LOCK_myisam);   /* Not exactly right... */
100
99
      }
101
100
      break;
102
101
    }
103
 
    ++it;
104
102
  }
105
103
  pthread_mutex_unlock(&THR_LOCK_myisam);
106
104
  if (!error)