~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_create.cc

  • Committer: Brian Aker
  • Date: 2009-10-15 00:22:33 UTC
  • mto: (1183.1.11 merge)
  • mto: This revision was merged to the branch mainline in revision 1198.
  • Revision ID: brian@gaz-20091015002233-fa4ao2mbc67wls91
First pass of information engine. OMG, ponies... is it so much easier to
deal with creating and engine.

The list table iterator though... its ass, needs to go. We should also
abstract out share. Very few engines need a custom one. Just say'in

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/mysys_priv.h"
 
17
#include "my_dir.h"
 
18
#include "mysys/mysys_err.h"
 
19
 
21
20
#include <errno.h>
22
 
 
23
 
#include "drizzled/error.h"
24
 
 
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
 
64
56
  */
65
57
  if (unlikely(fd >= 0 && rc < 0))
66
58
  {
67
 
    int tmp= errno;
 
59
    int tmp= my_errno;
68
60
    my_delete(FileName, MyFlags);
69
 
    errno= tmp;
 
61
    my_errno= tmp;
70
62
  }
71
63
 
72
64
  return(rc);
73
65
} /* my_create */
74
 
 
75
 
} /* namespace internal */
76
 
} /* namespace drizzled */