aboutsummaryrefslogtreecommitdiff
path: root/tests/pkd
diff options
context:
space:
mode:
authorAnderson Toshiyuki Sasaki <ansasaki@redhat.com>2019-06-13 13:18:49 +0200
committerAndreas Schneider <asn@cryptomilk.org>2019-06-13 16:29:32 +0200
commit905b027f0f628e5cec1ef635520307bae7447e10 (patch)
tree7665a5d685448249ff667e706246c0bbcf285aaf /tests/pkd
parent57cf0cf230884a2b04ca85e6f346b75f025ec471 (diff)
downloadlibssh-905b027f0f628e5cec1ef635520307bae7447e10.tar.gz
libssh-905b027f0f628e5cec1ef635520307bae7447e10.tar.xz
libssh-905b027f0f628e5cec1ef635520307bae7447e10.zip
tests/pkd: Check OpenSSH version only once
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'tests/pkd')
-rw-r--r--tests/pkd/pkd_util.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/pkd/pkd_util.c b/tests/pkd/pkd_util.c
index 4aded19e..087d969f 100644
--- a/tests/pkd/pkd_util.c
+++ b/tests/pkd/pkd_util.c
@@ -45,10 +45,14 @@ static int is_openssh_client_new_enough(void) {
FILE *fp = NULL;
char version[1024] = { 0 };
- int version_ok = 0;
+ static int version_ok = 0;
unsigned long int major = 0;
char *tmp = NULL;
+ if (version_ok) {
+ return version_ok;
+ }
+
fp = popen("ssh -V 2>&1", "r");
if (fp == NULL) {
fprintf(stderr, "failed to get OpenSSH client version\n");