~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/my_open.cc

Merge Monty - Updates to pandora-build to support features of gcc 4.5.

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
 
namespace internal {
 
28
namespace drizzled
 
29
{
 
30
namespace internal
 
31
{
30
32
 
31
33
/*
32
34
  Open a file
107
109
 
108
110
int my_register_filename(int fd, const char *FileName, uint32_t error_message_number, myf MyFlags)
109
111
{
110
 
  if (fd >= 0)
 
112
  if ((int) fd >= 0)
 
113
  {
111
114
    return fd;
 
115
  }
 
116
  else
 
117
    errno= errno;
 
118
 
112
119
  if (MyFlags & (MY_FFNF | MY_FAE | MY_WME))
113
120
  {
114
121
    if (errno == EMFILE)
115
122
      error_message_number= EE_OUT_OF_FILERESOURCES;
116
 
    my_error(static_cast<drizzled::error_t>(error_message_number), MYF(ME_BELL+ME_WAITTANG), FileName, errno);
 
123
    my_error(error_message_number, MYF(ME_BELL+ME_WAITTANG),
 
124
             FileName, errno);
117
125
  }
118
126
  return -1;
119
127
}