~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzleimport.cc

  • Committer: Siddharth Prakash Singh
  • Date: 2010-03-26 19:25:23 UTC
  • mfrom: (1410 drizzle)
  • mto: This revision was merged to the branch mainline in revision 1425.
  • Revision ID: spsneo@spsneo-laptop-20100326192523-ibjlbt1p692vobtj
merging with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
170
170
  my_print_variables(my_long_options);
171
171
}
172
172
 
173
 
static bool get_one_option(int optid, const struct my_option *, char *argument)
 
173
static int get_one_option(int optid, const struct my_option *, char *argument)
174
174
{
175
175
  char *endchar= NULL;
176
176
  uint64_t temp_drizzle_port= 0;
182
182
    if (strlen(endchar) != 0)
183
183
    {
184
184
      fprintf(stderr, _("Non-integer value supplied for port.  If you are trying to enter a password please use --password instead.\n"));
185
 
      exit(1);
 
185
      return EXIT_ARGUMENT_INVALID;
186
186
    }
187
187
    /* If the port number is > 65535 it is not a valid port
188
188
       This also helps with potential data loss casting unsigned long to a
190
190
    if ((temp_drizzle_port == 0) || (temp_drizzle_port > 65535))
191
191
    {
192
192
      fprintf(stderr, _("Value supplied for port is not valid.\n"));
193
 
      exit(1);
 
193
      return EXIT_ARGUMENT_INVALID;
194
194
    }
195
195
    else
196
196
    {
208
208
      {
209
209
        fprintf(stderr, "Memory allocation error while copying password. "
210
210
                        "Aborting.\n");
211
 
        exit(ENOMEM);
 
211
        return EXIT_OUT_OF_MEMORY;
212
212
      }
213
213
      while (*argument)
214
214
      {