~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/main.cc

  • Committer: Mark Atwood
  • Date: 2011-05-02 23:26:54 UTC
  • mfrom: (2290.1.9 server_uuid_repl)
  • Revision ID: me@mark.atwood.name-20110502232654-hd1ufzm7o4mtrutf
mergeĀ lp:~skinny.moey/drizzle/server_uuid_repl

Show diffs side-by-side

added added

removed removed

Lines of Context:
293
293
                    getDataHome().file_string().c_str());
294
294
      unireg_abort(1);
295
295
    }
 
296
 
 
297
    ifstream old_uuid_file ("server.uuid");
 
298
    if (old_uuid_file.is_open())
 
299
    {
 
300
      getline (old_uuid_file, server_uuid);
 
301
      old_uuid_file.close();
 
302
    } 
 
303
    else 
 
304
    {
 
305
      uuid_t uu;
 
306
      char uuid_string[37];
 
307
      uuid_generate_random(uu);
 
308
      uuid_unparse(uu, uuid_string);
 
309
      ofstream new_uuid_file ("server.uuid");
 
310
      new_uuid_file << uuid_string;
 
311
      new_uuid_file.close();
 
312
      server_uuid= string(uuid_string);
 
313
    }
 
314
 
296
315
    if (mkdir("local", 0700))
297
316
    {
298
317
      /* We don't actually care */
310
329
    errmsg_printf(error::INFO, "Data Home directory is : %s", full_data_home.native_file_string().c_str());
311
330
  }
312
331
 
313
 
 
314
 
 
315
332
  if (server_id == 0)
316
333
  {
317
334
    server_id= 1;