~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_open.cc

  • Committer: Brian Aker
  • Date: 2009-02-07 22:33:25 UTC
  • Revision ID: brian@tangent.org-20090207223325-5ipgldvw1pkghboq
typdef class removal (just... use the name of the class).

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
#include "mysys_priv.h"
17
17
#include "mysys_err.h"
18
 
#include <my_dir.h>
 
18
#include "my_dir.h"
 
19
 
19
20
#include <errno.h>
 
21
#include <stdlib.h>
 
22
#include <string.h>
20
23
 
21
24
/*
22
25
  Open a file
24
27
  SYNOPSIS
25
28
    my_open()
26
29
      FileName  Fully qualified file name
27
 
      Flags     Read | write 
 
30
      Flags     Read | write
28
31
      MyFlags   Special flags
29
32
 
30
33
  RETURN VALUE
77
80
  }
78
81
  if ((uint) fd < my_file_limit && my_file_info[fd].type != UNOPEN)
79
82
  {
80
 
    my_free(my_file_info[fd].name, MYF(0));
 
83
    free(my_file_info[fd].name);
81
84
#if !defined(HAVE_PREAD)
82
85
    pthread_mutex_destroy(&my_file_info[fd].mutex);
83
86
#endif
91
94
 
92
95
/*
93
96
  Register file in my_file_info[]
94
 
   
 
97
 
95
98
  SYNOPSIS
96
99
    my_register_filename()
97
100
    fd                     File number opened, -1 if error on open
107
110
*/
108
111
 
109
112
File my_register_filename(File fd, const char *FileName, enum file_type
110
 
                          type_of_file, uint error_message_number, myf MyFlags)
 
113
                          type_of_file, uint32_t error_message_number, myf MyFlags)
111
114
{
112
115
  if ((int) fd >= 0)
113
116
  {
123
126
    else
124
127
    {
125
128
      pthread_mutex_lock(&THR_LOCK_open);
126
 
      if ((my_file_info[fd].name = (char*) my_strdup(FileName,MyFlags)))
 
129
      if ((my_file_info[fd].name = (char*) strdup(FileName)))
127
130
      {
128
131
        my_file_opened++;
129
132
        my_file_total_opened++;
159
162
{
160
163
  if (my_file_opened | my_stream_opened)
161
164
  {
162
 
    uint i;
 
165
    uint32_t i;
163
166
    for (i= 0 ; i < my_file_limit ; i++)
164
167
    {
165
168
      if (my_file_info[i].type != UNOPEN)