~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_panic.c

  • Committer: Monty Taylor
  • Date: 2008-07-05 18:10:38 UTC
  • mto: This revision was merged to the branch mainline in revision 63.
  • Revision ID: monty@inaugust.com-20080705181038-0ih0nnamu5qrut0y
Fixed prototypes. Cleaned define a little bit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
   along with this program; if not, write to the Free Software
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
 
#include "myisamdef.h"
 
16
#include "fulltext.h"
17
17
 
18
18
        /* if flag == HA_PANIC_CLOSE then all misam files are closed */
19
19
        /* if flag == HA_PANIC_WRITE then all misam files are unlocked and
28
28
  int error=0;
29
29
  LIST *list_element,*next_open;
30
30
  MI_INFO *info;
 
31
  DBUG_ENTER("mi_panic");
31
32
 
32
33
  pthread_mutex_lock(&THR_LOCK_myisam);
33
34
  for (list_element=myisam_open_list ; list_element ; list_element=next_open)
56
57
        if (flush_io_cache(&info->rec_cache))
57
58
          error=my_errno;
58
59
        reinit_io_cache(&info->rec_cache,READ_CACHE,0,
59
 
                       (bool) (info->lock_type != F_UNLCK),1);
 
60
                       (pbool) (info->lock_type != F_UNLCK),1);
60
61
      }
61
62
      if (info->lock_type != F_UNLCK && ! info->was_locked)
62
63
      {
100
101
      break;
101
102
    }
102
103
  }
 
104
  if (flag == HA_PANIC_CLOSE)
 
105
  {
 
106
    VOID(mi_log(0));                            /* Close log if neaded */
 
107
    ft_free_stopwords();
 
108
  }
103
109
  pthread_mutex_unlock(&THR_LOCK_myisam);
104
110
  if (!error)
105
 
    return(0);
106
 
  return(my_errno=error);
 
111
    DBUG_RETURN(0);
 
112
  DBUG_RETURN(my_errno=error);
107
113
} /* mi_panic */