} else if (po->flags & OPT_FLOAT) {
*po->u.float_arg = parse_number_or_die(opt, arg, OPT_FLOAT, -1.0/0.0, 1.0/0.0);
} else if (po->flags & OPT_FUNC2) {
- if(po->u.func2_arg(opt, arg)<0)
- goto unknown_opt;
+ if (po->u.func2_arg(opt, arg) < 0) {
+ fprintf(stderr, "%s: invalid value '%s' for option '%s'\n", argv[0], arg, opt);
+ exit(1);
+ }
} else {
po->u.func_arg(arg);
}
int opt_timelimit(const char *opt, const char *arg)
{
-#if HAVE_SYS_RESOURCE_H
+#if HAVE_SETRLIMIT
int lim = parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX);
struct rlimit rl = { lim, lim + 1 };
if (setrlimit(RLIMIT_CPU, &rl))