-/* $OpenBSD: apps.c,v 1.38 2016/08/26 15:04:15 deraadt Exp $ */
+/* $OpenBSD: apps.c,v 1.39 2016/08/30 14:34:59 deraadt Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
*opt->opt.lvalue = (long)val;
break;
+ case OPTION_ARG_TIME:
+ val = strtonum(argv[i], 0, LLONG_MAX, &errstr);
+ if (errstr != NULL) {
+ fprintf(stderr, "%s %s argument for -%s\n",
+ errstr, opt->argname, opt->name);
+ return (1);
+ }
+ *opt->opt.tvalue = val;
+ break;
+
case OPTION_DISCARD:
break;
-/* $OpenBSD: apps.h,v 1.18 2016/08/30 11:30:14 deraadt Exp $ */
+/* $OpenBSD: apps.h,v 1.19 2016/08/30 14:34:59 deraadt Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
OPTION_ARG_FUNC,
OPTION_ARG_INT,
OPTION_ARG_LONG,
+ OPTION_ARG_TIME,
OPTION_DISCARD,
OPTION_FUNC,
OPTION_FLAG,
-/* $OpenBSD: s_time.c,v 1.15 2016/08/30 11:30:14 deraadt Exp $ */
+/* $OpenBSD: s_time.c,v 1.16 2016/08/30 14:34:59 deraadt Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
.name = "time",
.argname = "seconds",
.desc = "Duration to perform timing tests for (default 30)",
- .type = OPTION_ARG_INT,
+ .type = OPTION_ARG_TIME,
.opt.tvalue = &s_time_config.maxtime,
},
{