In preparation for having main() handle the return value.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
/*
* daemon argument parsing
*/
-static void parse_args(int argc, char **argv)
+static int parse_args(int argc, char **argv)
{
- int c;
+ int c, ret = 0;
static struct option long_options[] = {
{ "consumerd-cmd-sock", 1, 0, 'c' },
fprintf(stderr, "option %s", long_options[option_index].name);
if (optarg) {
fprintf(stderr, " with arg %s\n", optarg);
+ ret = -1;
+ goto end;
}
break;
case 'c':
#endif
default:
usage(stderr);
- exit(EXIT_FAILURE);
+ ret = -1;
+ goto end;
}
}
+end:
+ return ret;
}
/*