~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/mf_tempfile.cc

  • Committer: Monty Taylor
  • Date: 2009-12-23 08:01:21 UTC
  • mto: This revision was merged to the branch mainline in revision 1253.
  • Revision ID: mordred@inaugust.com-20091223080121-iveugdrewkp7iqyi
Oy. Bigger change than I normally like - but this stuff is all intertwined.
Moved a bunch of things to public drizzled/ area. Split some files. Made some
convenience libs. EVENTUALLY, some of this will be able to be re-factored, but
for now I'm ok with erring on the side of too many files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#include "mysys/mysys_priv.h"
17
17
#include <mystrings/m_string.h>
18
18
#include "my_static.h"
19
 
#include "mysys/mysys_err.h"
 
19
#include "drizzled/my_error.h"
20
20
#include <stdio.h>
21
21
#include <errno.h>
22
22
#include <string>
67
67
    dir= P_tmpdir;
68
68
  if (strlen(dir)+prefix_str.length() > FN_REFLEN-2)
69
69
  {
70
 
    errno=my_errno= ENAMETOOLONG;
 
70
    errno=errno= ENAMETOOLONG;
71
71
    return(file);
72
72
  }
73
73
  strcpy(convert_dirname(to,dir,NULL),prefix_str.c_str());
82
82
  /* If we didn't manage to register the name, remove the temp file */
83
83
  if (org_file >= 0 && file < 0)
84
84
  {
85
 
    int tmp=my_errno;
 
85
    int tmp=errno;
86
86
    close(org_file);
87
87
    (void) my_delete(to, MYF(MY_WME | ME_NOINPUT));
88
 
    my_errno=tmp;
 
88
    errno=tmp;
89
89
  }
90
90
  if (file >= 0)
91
91
    my_tmp_file_created++;