~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_init.c

  • Committer: Brian Aker
  • Date: 2008-07-18 20:10:26 UTC
  • mfrom: (51.3.29 remove-dbug)
  • Revision ID: brian@tangent.org-20080718201026-tto5golt0xhwqe4a
Merging in Jay's final patch on dbug.

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
  fastmutex_global_init();              /* Must be called early */
65
65
#endif
66
66
#if defined(HAVE_PTHREAD_INIT)
67
 
  pthread_init();                       /* Must be called before DBUG_ENTER */
 
67
  pthread_init();
68
68
#endif
69
69
  if (my_thread_global_init())
70
70
    return 1;
71
71
  sigfillset(&my_signals);              /* signals blocked by mf_brkhant */
72
72
  {
73
 
    DBUG_ENTER("my_init");
74
 
    DBUG_PROCESS((char*) (my_progname ? my_progname : "unknown"));
75
73
    if (!home_dir)
76
74
    {                                   /* Don't initialize twice */
77
75
      if ((home_dir=getenv("HOME")) != 0)
82
80
        /* Default creation of new dir's */
83
81
      if ((str=getenv("UMASK_DIR")) != 0)
84
82
        my_umask_dir=(int) (atoi_octal(str) | 0700);
85
 
      DBUG_PRINT("exit",("home: '%s'",home_dir));
86
83
    }
87
 
    DBUG_RETURN(0);
 
84
    return(0);
88
85
  }
89
86
} /* my_init */
90
87
 
98
95
    Sun CC: Sun C++ 5.6 2004/06/02 for x86, and should not be
99
96
    optimized until this compiler is not in use anymore
100
97
  */
101
 
  FILE *info_file= DBUG_FILE;
102
 
  bool print_info= (info_file != stderr);
103
 
  /*
104
 
    We do not use DBUG_ENTER here, as after cleanup DBUG is no longer
105
 
    operational, so we cannot use DBUG_RETURN.
106
 
  */
107
 
  DBUG_PRINT("info",("Shutting down: infoflag: %d  print_info: %d",
108
 
                     infoflag, print_info));
109
 
  if (!info_file)
110
 
  {
111
 
    info_file= stderr;
112
 
    print_info= 0;
113
 
  }
 
98
  FILE *info_file= stderr;
 
99
  bool print_info= 0;
114
100
 
115
101
  if ((infoflag & MY_CHECK_ERROR) || print_info)
116
102
 
119
105
    {
120
106
      sprintf(errbuff[0],EE(EE_OPEN_WARNING),my_file_opened,my_stream_opened);
121
107
      (void) my_message_no_curses(EE_OPEN_WARNING,errbuff[0],ME_BELL);
122
 
      DBUG_PRINT("error",("%s",errbuff[0]));
123
108
      my_print_open_files();
124
109
    }
125
110
  }
158
143
    TERMINATE(stderr, 0);               /* Print memory leaks on screen */
159
144
  }
160
145
 
161
 
  if (!(infoflag & MY_DONT_FREE_DBUG))
162
 
  {
163
 
    DBUG_END();                /* Must be done before my_thread_end */
164
 
  }
165
146
  my_thread_end();
166
147
  my_thread_global_end();
167
148
#if defined(SAFE_MUTEX)