~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_open.cc

  • Committer: Brian Aker
  • Date: 2009-04-27 14:36:40 UTC
  • Revision ID: brian@gaz-20090427143640-f6zjmtt9vm55qgm2
Patch on show processlist from  davi@apache.org

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 "mysys_priv.h"
17
 
#include "mysys_err.h"
18
 
#include <my_dir.h>
 
16
#include "mysys/mysys_priv.h"
 
17
#include "mysys/mysys_err.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
75
78
    if (MyFlags & (MY_FAE | MY_WME))
76
79
      my_error(EE_BADCLOSE, MYF(ME_BELL+ME_WAITTANG),my_filename(fd),errno);
77
80
  }
78
 
  if ((uint) fd < my_file_limit && my_file_info[fd].type != UNOPEN)
 
81
  if ((uint32_t) fd < my_file_limit && my_file_info[fd].type != UNOPEN)
79
82
  {
80
83
    free(my_file_info[fd].name);
81
84
#if !defined(HAVE_PREAD)
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
111
114
{
112
115
  if ((int) fd >= 0)
113
116
  {
114
 
    if ((uint) fd >= my_file_limit)
 
117
    if ((uint32_t) fd >= my_file_limit)
115
118
    {
116
119
#if !defined(HAVE_PREAD)
117
120
      my_errno= EMFILE;
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++;