~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/my_open.cc

  • Committer: Mark Atwood
  • Date: 2011-08-12 04:08:33 UTC
  • mfrom: (2385.2.17 refactor5)
  • Revision ID: me@mark.atwood.name-20110812040833-u6j85nc6ahuc0dtz
mergeĀ lp:~olafvdspek/drizzle/refactor5

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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
15
15
 
16
 
#include "config.h"
 
16
#include <config.h>
17
17
 
18
 
#include "drizzled/internal/my_sys.h"
19
 
#include "drizzled/error.h"
 
18
#include <drizzled/internal/my_sys.h>
 
19
#include <drizzled/error.h>
20
20
 
21
21
#include <fcntl.h>
22
22
 
25
25
#include <cstring>
26
26
 
27
27
 
28
 
namespace drizzled
29
 
{
30
 
namespace internal
31
 
{
 
28
namespace drizzled {
 
29
namespace internal {
32
30
 
33
31
/*
34
32
  Open a file
109
107
 
110
108
int my_register_filename(int fd, const char *FileName, uint32_t error_message_number, myf MyFlags)
111
109
{
112
 
  if ((int) fd >= 0)
113
 
  {
 
110
  if (fd >= 0)
114
111
    return fd;
115
 
  }
116
 
  else
117
 
    errno= errno;
118
 
 
119
112
  if (MyFlags & (MY_FFNF | MY_FAE | MY_WME))
120
113
  {
121
114
    if (errno == EMFILE)
122
115
      error_message_number= EE_OUT_OF_FILERESOURCES;
123
 
    my_error(static_cast<drizzled::error_t>(error_message_number), MYF(ME_BELL+ME_WAITTANG),
124
 
             FileName, errno);
 
116
    my_error(static_cast<drizzled::error_t>(error_message_number), MYF(ME_BELL+ME_WAITTANG), FileName, errno);
125
117
  }
126
118
  return -1;
127
119
}