mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
tests/pkd: Check OpenSSH version only once
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
57cf0cf230
commit
905b027f0f
@@ -45,10 +45,14 @@ static int is_openssh_client_new_enough(void) {
|
|||||||
FILE *fp = NULL;
|
FILE *fp = NULL;
|
||||||
char version[1024] = { 0 };
|
char version[1024] = { 0 };
|
||||||
|
|
||||||
int version_ok = 0;
|
static int version_ok = 0;
|
||||||
unsigned long int major = 0;
|
unsigned long int major = 0;
|
||||||
char *tmp = NULL;
|
char *tmp = NULL;
|
||||||
|
|
||||||
|
if (version_ok) {
|
||||||
|
return version_ok;
|
||||||
|
}
|
||||||
|
|
||||||
fp = popen("ssh -V 2>&1", "r");
|
fp = popen("ssh -V 2>&1", "r");
|
||||||
if (fp == NULL) {
|
if (fp == NULL) {
|
||||||
fprintf(stderr, "failed to get OpenSSH client version\n");
|
fprintf(stderr, "failed to get OpenSSH client version\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user