~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/main.cc

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include <config.h>
 
20
#include "config.h"
21
21
 
22
22
#include <pthread.h>
23
23
#include <signal.h>
66
66
#include <drizzled/tztime.h>
67
67
#include <drizzled/unireg.h>
68
68
#include <drizzled/util/backtrace.h>
69
 
#include <drizzled/current_session.h>
70
 
#include <drizzled/daemon.h>
 
69
 
 
70
extern "C" int daemonize(int nochdir, int noclose, int wait_sigusr1);
 
71
extern "C" int daemon_is_ready(void);
71
72
 
72
73
using namespace drizzled;
73
74
using namespace std;
 
75
namespace fs=boost::filesystem;
74
76
 
75
77
static pthread_t select_thread;
76
78
static uint32_t thr_kill_signal;
102
104
      return;
103
105
 
104
106
    /*
105
 
      session->getLex()->current_select == 0 if lex structure is not inited
 
107
      session->lex->current_select == 0 if lex structure is not inited
106
108
      (not query command (COM_QUERY))
107
109
    */
108
 
    if (! (session->getLex()->current_select &&
109
 
           session->getLex()->current_select->no_error && !session->is_fatal_error))
 
110
    if (! (session->lex->current_select &&
 
111
           session->lex->current_select->no_error && !session->is_fatal_error))
110
112
    {
111
113
      if (! session->main_da.is_error())            // Return only first message
112
114
      {
259
261
    {
260
262
      perror("Failed to ignore SIGHUP");
261
263
    }
262
 
    if (daemonize())
 
264
    if (daemonize(1, 1, 1) == -1)
263
265
    {
264
266
      fprintf(stderr, "failed to daemon() in order to daemonize\n");
265
267
      exit(EXIT_FAILURE);
300
302
      unireg_abort(1);
301
303
    }
302
304
 
303
 
    boost::filesystem::path &full_data_home= getFullDataHome();
304
 
    full_data_home= boost::filesystem::system_complete(getDataHome());
305
 
    errmsg_printf(error::INFO, "Data Home directory is : %s", full_data_home.native_file_string().c_str());
 
305
    fs::path &full_data_home= getFullDataHome();
 
306
    full_data_home= fs::system_complete(getDataHome());
 
307
    std::cerr << "home " << full_data_home << std::endl;
306
308
  }
307
309
 
308
310
 
347
349
    unireg_abort(1);
348
350
 
349
351
  assert(plugin::num_trx_monitored_objects > 0);
350
 
  if (drizzle_rm_tmp_tables())
 
352
  if (drizzle_rm_tmp_tables() || my_tz_init((Session *)0, default_tz_name))
351
353
  {
352
354
    abort_loop= true;
353
355
    select_thread_in_use=0;