~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_init.cc

Merge Devananda's LENGTH UDF plugin

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
   along with this program; if not, write to the Free Software
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
 
#include "mysys_priv.h"
 
16
#include "mysys/mysys_priv.h"
17
17
#include "my_static.h"
18
18
#include <mysys/mysys_err.h>
19
19
#include <mystrings/m_string.h>
20
20
#include <mystrings/m_ctype.h>
21
 
#include <signal.h>
 
21
#include <stdio.h>
 
22
#include <stdlib.h>
22
23
 
23
24
bool my_init_done= 0;
24
25
uint    mysys_usage_id= 0;              /* Incremented for each my_init() */
25
 
uint32_t   my_thread_stack_size= 65536;
26
26
 
27
27
static uint32_t atoi_octal(const char *str)
28
28
{
29
29
  long int tmp;
30
30
  while (*str && my_isspace(&my_charset_utf8_general_ci, *str))
31
31
    str++;
32
 
  str2int(str,
33
 
          (*str == '0' ? 8 : 10),       /* Octalt or decimalt */
34
 
          0, INT_MAX, &tmp);
 
32
  tmp= strtol(str, NULL, (*str == '0' ? 8 : 10));
35
33
  return (uint32_t) tmp;
36
34
}
37
35
 
57
55
  my_umask= 0660;                       /* Default umask for new files */
58
56
  my_umask_dir= 0700;                   /* Default umask for new directories */
59
57
  init_glob_errs();
60
 
#if defined(SAFE_MUTEX)
61
 
  safe_mutex_global_init();             /* Must be called early */
62
 
#endif
63
 
#if defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX)
64
 
  fastmutex_global_init();              /* Must be called early */
65
 
#endif
66
58
#if defined(HAVE_PTHREAD_INIT)
67
59
  pthread_init();
68
60
#endif
103
95
  {                                     /* Test if some file is left open */
104
96
    if (my_file_opened | my_stream_opened)
105
97
    {
106
 
      sprintf(errbuff[0],EE(EE_OPEN_WARNING),my_file_opened,my_stream_opened);
107
 
      (void) my_message_no_curses(EE_OPEN_WARNING,errbuff[0],ME_BELL);
 
98
      /* TODO: Mark... look at replacement here
 
99
       * (void) my_message_no_curses(EE_OPEN_WARNING,errbuff[0],ME_BELL);
 
100
       */
 
101
      (void) fflush(stdout);
 
102
      
108
103
      my_print_open_files();
109
104
    }
110
105
  }
111
106
  free_charsets();
112
107
  my_error_unregister_all();
113
 
  my_once_free();
114
108
 
115
109
  if ((infoflag & MY_GIVE_INFO) || print_info)
116
110
  {
145
139
 
146
140
  my_thread_end();
147
141
  my_thread_global_end();
148
 
#if defined(SAFE_MUTEX)
149
 
  /*
150
 
    Check on destroying of mutexes. A few may be left that will get cleaned
151
 
    up by C++ destructors
152
 
  */
153
 
  safe_mutex_end();
154
 
 
155
 
#endif /* defined(SAFE_MUTEX) */
156
142
 
157
143
  my_init_done=0;
158
144
} /* my_end */