~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_create.cc

  • Committer: Monty Taylor
  • Date: 2008-11-16 05:36:13 UTC
  • mto: (584.1.9 devel)
  • mto: This revision was merged to the branch mainline in revision 589.
  • Revision ID: monty@inaugust.com-20081116053613-bld4rqxhlkb49c02
Split out cache_row and type_holder.

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 */
15
 
 
16
 
#include "config.h"
17
 
 
18
 
#include "drizzled/internal/my_sys.h"
19
 
 
20
 
#include <fcntl.h>
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
#include "mysys_priv.h"
 
17
#include <my_dir.h>
 
18
#include "mysys_err.h"
21
19
#include <errno.h>
22
 
 
23
 
#include "drizzled/error.h"
24
 
 
 
20
#include <my_sys.h>
25
21
        /*
26
22
        ** Create a new file
27
23
        ** Arguments:
31
27
        ** Special flags
32
28
        */
33
29
 
34
 
namespace drizzled
35
 
{
36
 
namespace internal
37
 
{
38
30
 
39
 
int my_create(const char *FileName, int CreateFlags, int access_flags,
40
 
              myf MyFlags)
 
31
File my_create(const char *FileName, int CreateFlags, int access_flags,
 
32
               myf MyFlags)
41
33
{
42
34
  int fd, rc;
43
35
 
55
47
    fd= -1;
56
48
  }
57
49
 
58
 
  rc= my_register_filename(fd, FileName, EE_CANTCREATEFILE, MyFlags);
 
50
  rc= my_register_filename(fd, FileName, FILE_BY_CREATE,
 
51
                           EE_CANTCREATEFILE, MyFlags);
59
52
  /*
60
53
    my_register_filename() may fail on some platforms even if the call to
61
54
    *open() above succeeds. In this case, don't leave the stale file because
64
57
  */
65
58
  if (unlikely(fd >= 0 && rc < 0))
66
59
  {
67
 
    int tmp= errno;
 
60
    int tmp= my_errno;
68
61
    my_delete(FileName, MyFlags);
69
 
    errno= tmp;
 
62
    my_errno= tmp;
70
63
  }
71
 
 
 
64
  
72
65
  return(rc);
73
66
} /* my_create */
74
 
 
75
 
} /* namespace internal */
76
 
} /* namespace drizzled */