~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_create.c

  • Committer: Mats Kindahl
  • Date: 2008-08-26 07:32:59 UTC
  • mto: (489.1.2 codestyle)
  • mto: This revision was merged to the branch mainline in revision 491.
  • Revision ID: mats@mysql.com-20080826073259-9k4evtajgldgolli
Replaced use of thd_proc_info() macro with calls to
set_proc_info() and get_proc_info() internally.  Introduced
functions set_thd_proc_info() and get_thd_proc_info() for
external users, i.e., plug-ins.

The set_thd_proc_info() accepted callers info that can be used to
print debug output, but the information was not used. The return
value was changed to void and the old value is not fetched any
more. To be able to get the value of proc_info for external
users, the function get_thd_proc_info() was introduced.

The thd_proc_info() macro called set_thd_proc_info() but almost
never used the return value of set_thd_proc_info() so the macro
was replaced with a call of THD::set_proc_info().

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 */