summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorinoguchi <inoguchi@openbsd.org>2020-09-09 12:47:46 +0000
committerinoguchi <inoguchi@openbsd.org>2020-09-09 12:47:46 +0000
commit6fde9eb95e0ded665bd8a1a0f54876e35e190156 (patch)
treeaebe29f3a26927575e752c99a566c14b1bd34e68
parentSet alpn_selected_len = 0 when alpn_selected is NULL (diff)
downloadwireguard-openbsd-6fde9eb95e0ded665bd8a1a0f54876e35e190156.tar.xz
wireguard-openbsd-6fde9eb95e0ded665bd8a1a0f54876e35e190156.zip
Add option type OPTION_UL_VALUE_OR
ok tb@
-rw-r--r--usr.bin/openssl/apps.c6
-rw-r--r--usr.bin/openssl/apps.h5
2 files changed, 9 insertions, 2 deletions
diff --git a/usr.bin/openssl/apps.c b/usr.bin/openssl/apps.c
index c9a2f34b253..2c2f1284848 100644
--- a/usr.bin/openssl/apps.c
+++ b/usr.bin/openssl/apps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apps.c,v 1.54 2019/07/14 03:30:45 guenther Exp $ */
+/* $OpenBSD: apps.c,v 1.55 2020/09/09 12:47:46 inoguchi Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
@@ -2299,6 +2299,10 @@ options_parse(int argc, char **argv, const struct option *opts, char **unnamed,
*opt->opt.value |= opt->value;
break;
+ case OPTION_UL_VALUE_OR:
+ *opt->opt.ulvalue |= opt->ulvalue;
+ break;
+
default:
fprintf(stderr, "option %s - unknown type %i\n",
opt->name, opt->type);
diff --git a/usr.bin/openssl/apps.h b/usr.bin/openssl/apps.h
index 48e5ba3adb9..10612a9c979 100644
--- a/usr.bin/openssl/apps.h
+++ b/usr.bin/openssl/apps.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: apps.h,v 1.23 2019/07/14 03:30:45 guenther Exp $ */
+/* $OpenBSD: apps.h,v 1.24 2020/09/09 12:47:46 inoguchi Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -303,6 +303,7 @@ struct option {
OPTION_VALUE,
OPTION_VALUE_AND,
OPTION_VALUE_OR,
+ OPTION_UL_VALUE_OR,
} type;
union {
char **arg;
@@ -312,9 +313,11 @@ struct option {
int (*func)(void);
long *lvalue;
int *value;
+ unsigned long *ulvalue;
time_t *tvalue;
} opt;
const int value;
+ const unsigned long ulvalue;
};
void options_usage(const struct option *opts);