~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_close.cc

Remove PLUGIN and MODULES.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
*/
22
22
 
23
23
#include "myisam_priv.h"
 
24
#include <cstdlib>
24
25
 
25
26
int mi_close(MI_INFO *info)
26
27
{
37
38
  if (info->lock_type != F_UNLCK)
38
39
  {
39
40
    if (mi_lock_database(info,F_UNLCK))
40
 
      error=my_errno;
 
41
      error=errno;
41
42
  }
42
43
  pthread_mutex_lock(&share->intern_lock);
43
44
 
49
50
  if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED))
50
51
  {
51
52
    if (end_io_cache(&info->rec_cache))
52
 
      error=my_errno;
 
53
      error=errno;
53
54
    info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
54
55
  }
55
56
  flag= !--share->reopen;
65
66
        flush_key_blocks(share->key_cache, share->kfile,
66
67
                         share->temporary ? FLUSH_IGNORE_CHANGED :
67
68
                         FLUSH_RELEASE))
68
 
      error=my_errno;
 
69
      error=errno;
69
70
    if (share->kfile >= 0)
70
71
    {
71
72
      /*
77
78
      if (share->mode != O_RDONLY && mi_is_crashed(info))
78
79
        mi_state_info_write(share->kfile, &share->state, 1);
79
80
      if (my_close(share->kfile,MYF(0)))
80
 
        error = my_errno;
 
81
        error = errno;
81
82
    }
82
83
    if (share->decode_trees)
83
84
    {
100
101
  pthread_mutex_unlock(&THR_LOCK_myisam);
101
102
 
102
103
  if (info->dfile >= 0 && my_close(info->dfile,MYF(0)))
103
 
    error = my_errno;
 
104
    error = errno;
104
105
 
105
106
  free((unsigned char*) info);
106
107
 
107
108
  if (error)
108
109
  {
109
 
    return(my_errno=error);
 
110
    return(errno=error);
110
111
  }
111
112
  return(0);
112
113
} /* mi_close */