~posulliv/drizzle/optimizer-style-cleanup

« back to all changes in this revision

Viewing changes to client/drizzleslap.cc

  • Committer: Padraig O'Sullivan
  • Date: 2010-04-17 01:38:47 UTC
  • mfrom: (1237.9.238 bad-staging)
  • Revision ID: osullivan.padraig@gmail.com-20100417013847-ibjioqsfbmf5yg4g
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
528
528
}
529
529
 
530
530
 
531
 
static struct my_option my_long_options[] =
 
531
static struct option my_long_options[] =
532
532
{
533
533
  {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
534
534
   0, 0, 0, 0, 0, 0},
727
727
  my_print_help(my_long_options);
728
728
}
729
729
 
730
 
static bool get_one_option(int optid, const struct my_option *, char *argument)
 
730
static int get_one_option(int optid, const struct option *, char *argument)
731
731
{
732
732
  char *endchar= NULL;
733
733
  uint64_t temp_drizzle_port= 0;
742
742
    if (strlen(endchar) != 0)
743
743
    {
744
744
      fprintf(stderr, _("Non-integer value supplied for port.  If you are trying to enter a password please use --password instead.\n"));
745
 
      exit(1);
 
745
      return EXIT_ARGUMENT_INVALID;
746
746
    }
747
747
    /* If the port number is > 65535 it is not a valid port
748
748
       This also helps with potential data loss casting unsigned long to a
750
750
    if ((temp_drizzle_port == 0) || (temp_drizzle_port > 65535))
751
751
    {
752
752
      fprintf(stderr, _("Value supplied for port is not valid.\n"));
753
 
      exit(1);
 
753
      return EXIT_ARGUMENT_INVALID;
754
754
    }
755
755
    else
756
756
    {
768
768
      {
769
769
        fprintf(stderr, "Memory allocation error while copying password. "
770
770
                        "Aborting.\n");
771
 
        exit(ENOMEM);
 
771
        return EXIT_OUT_OF_MEMORY;
772
772
      }
773
773
      while (*argument)
774
774
      {