~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

  • Committer: Eric Day
  • Date: 2009-08-31 23:50:37 UTC
  • mto: This revision was merged to the branch mainline in revision 1134.
  • Revision ID: eday@oddments.org-20090831235037-hwwe6zhq94o4lxtd
Removed purecov messages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
536
536
    errmsg_printf(ERRMSG_LVL_ERROR, _("Aborting\n"));
537
537
  else if (opt_help || opt_help_extended)
538
538
    usage();
539
 
  clean_up(!opt_help && (exit_code)); /* purecov: inspected */
 
539
  clean_up(!opt_help && (exit_code));
540
540
  clean_up_mutexes();
541
541
  my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
542
 
  exit(exit_code); /* purecov: inspected */
 
542
  exit(exit_code);
543
543
}
544
544
 
545
545
 
547
547
{
548
548
  plugin::Registry &plugins= plugin::Registry::singleton();
549
549
  if (cleanup_done++)
550
 
    return; /* purecov: inspected */
 
550
    return;
551
551
 
552
552
  table_cache_free();
553
553
  TableShare::cacheStop();
651
651
    if (user)
652
652
    {
653
653
      /* Don't give a warning, if real user is same as given with --user */
654
 
      /* purecov: begin tested */
655
654
      tmp_user_info= getpwnam(user);
656
655
      if ((!tmp_user_info || user_id != tmp_user_info->pw_uid) &&
657
656
          global_system_variables.log_warnings)
658
657
            errmsg_printf(ERRMSG_LVL_WARN, _("One can only use the --user switch "
659
658
                            "if running as root\n"));
660
 
      /* purecov: end */
661
659
    }
662
660
    return NULL;
663
661
  }
667
665
                      "the manual to find out how to run drizzled as root!\n"));
668
666
    unireg_abort(1);
669
667
  }
670
 
  /* purecov: begin tested */
671
668
  if (!strcmp(user,"root"))
672
669
    return NULL;                        // Avoid problem with dynamic libraries
673
670
 
682
679
      goto err;
683
680
  }
684
681
  return tmp_user_info;
685
 
  /* purecov: end */
686
682
 
687
683
err:
688
684
  errmsg_printf(ERRMSG_LVL_ERROR, _("Fatal error: Can't change to run as user '%s' ;  "
706
702
 
707
703
static void set_user(const char *user, struct passwd *user_info_arg)
708
704
{
709
 
  /* purecov: begin tested */
710
705
  assert(user_info_arg != 0);
711
706
#ifdef HAVE_INITGROUPS
712
707
  /*
729
724
    sql_perror("setuid");
730
725
    unireg_abort(1);
731
726
  }
732
 
  /* purecov: end */
733
727
}
734
728
 
735
729
 
1114
1108
    }
1115
1109
  }
1116
1110
  if (!session || MyFlags & ME_NOREFRESH)
1117
 
    errmsg_printf(ERRMSG_LVL_ERROR, "%s: %s",my_progname,str); /* purecov: inspected */
 
1111
    errmsg_printf(ERRMSG_LVL_ERROR, "%s: %s",my_progname,str);
1118
1112
}
1119
1113
 
1120
1114
 
1517
1511
 
1518
1512
  check_data_home(drizzle_real_data_home);
1519
1513
  if (chdir(drizzle_real_data_home) && !opt_help)
1520
 
    unireg_abort(1);                            /* purecov: inspected */
 
1514
    unireg_abort(1);
1521
1515
  drizzle_data_home= drizzle_data_home_buff;
1522
1516
  drizzle_data_home[0]=FN_CURLIB;               // all paths are relative from here
1523
1517
  drizzle_data_home[1]=0;
2519
2513
 
2520
2514
  const char *sharedir= get_relative_path(PKGDATADIR);
2521
2515
  if (test_if_hard_path(sharedir))
2522
 
    strncpy(buff,sharedir,sizeof(buff)-1);              /* purecov: tested */
 
2516
    strncpy(buff,sharedir,sizeof(buff)-1);
2523
2517
  else
2524
2518
  {
2525
2519
    strcpy(buff, drizzle_home);