~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/mf_cache.cc

  • Committer: Brian Aker
  • Date: 2009-01-24 09:43:35 UTC
  • Revision ID: brian@gir-3.local-20090124094335-6qdtvc35gl5fvivz
Adding in an example singe thread scheduler

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
/* Open a temporary file and cache it with io_cache. Delete it on close */
17
17
 
18
 
#include "config.h"
19
 
 
20
 
#include "drizzled/internal/my_sys.h"
21
 
#include "drizzled/internal/m_string.h"
22
 
#include "drizzled/internal/my_static.h"
23
 
#include "drizzled/internal/iocache.h"
24
 
#include "drizzled/error.h"
25
 
 
26
 
namespace drizzled
27
 
{
28
 
namespace internal
29
 
{
 
18
#include "mysys_priv.h"
 
19
#include <mystrings/m_string.h>
 
20
#include <mysys/my_static.h>
 
21
#include <mysys/mysys_err.h>
 
22
#include <mysys/iocache.h>
 
23
 
30
24
 
31
25
        /*
32
26
        ** Open tempfile cached by IO_CACHE
62
56
{
63
57
  char name_buff[FN_REFLEN];
64
58
  int error=1;
65
 
  if ((cache->file=create_temp_file(name_buff, cache->dir, cache->prefix, MYF(MY_WME))) >= 0)
 
59
  if ((cache->file=create_temp_file(name_buff, cache->dir, cache->prefix,
 
60
                                    (O_RDWR | O_TRUNC),
 
61
                                    MYF(MY_WME))) >= 0)
66
62
  {
67
63
    error=0;
68
64
    my_delete(name_buff,MYF(MY_WME | ME_NOINPUT));
75
71
{
76
72
  if (my_b_inited(cache))
77
73
  {
78
 
    int file=cache->file;
 
74
    File file=cache->file;
79
75
    cache->file= -1;                            /* Don't flush data */
80
76
    (void) end_io_cache(cache);
81
77
    if (file >= 0)
94
90
  }
95
91
  return;
96
92
}
97
 
 
98
 
} /* namespace internal */
99
 
} /* namespace drizzled */