~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/my_open.cc

Merge in security refactor.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
#include "config.h"
17
17
 
18
18
#include "drizzled/internal/my_sys.h"
19
 
#include "drizzled/error.h"
 
19
#include "drizzled/my_error.h"
20
20
 
21
21
#include <fcntl.h>
22
22
 
85
85
    if (MyFlags & (MY_FAE | MY_WME))
86
86
      my_error(EE_BADCLOSE, MYF(ME_BELL+ME_WAITTANG), "unknown", errno);
87
87
  }
 
88
  my_file_opened--;
88
89
 
89
90
  return(err);
90
91
} /* my_close */
111
112
{
112
113
  if ((int) fd >= 0)
113
114
  {
 
115
    my_file_opened++;
 
116
    my_file_total_opened++;
 
117
 
114
118
    return fd;
115
119
  }
116
120
  else
120
124
  {
121
125
    if (errno == EMFILE)
122
126
      error_message_number= EE_OUT_OF_FILERESOURCES;
123
 
    my_error(static_cast<drizzled::error_t>(error_message_number), MYF(ME_BELL+ME_WAITTANG),
 
127
    my_error(error_message_number, MYF(ME_BELL+ME_WAITTANG),
124
128
             FileName, errno);
125
129
  }
126
130
  return -1;