From dbd79ca61719b81dd540760fd11203cc85e0a3b0 Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Wed, 24 Jul 2013 16:28:35 +0200
Subject: [PATCH] ssl_client2 and ssl_server2 now exit with 1 on errors (shell
limitations)
---
programs/ssl/ssl_client2.c | 4 ++++
programs/ssl/ssl_server2.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c
index ca4d7c74e..591f4c49e 100644
--- a/programs/ssl/ssl_client2.c
+++ b/programs/ssl/ssl_client2.c
@@ -805,6 +805,10 @@ exit:
fflush( stdout ); getchar();
#endif
+ // Shell can not handle large exit numbers -> 1 for errors
+ if( ret < 0 )
+ ret = 1;
+
return( ret );
}
#endif /* POLARSSL_BIGNUM_C && POLARSSL_ENTROPY_C && POLARSSL_SSL_TLS_C &&
diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c
index c12e2d031..9628afb06 100644
--- a/programs/ssl/ssl_server2.c
+++ b/programs/ssl/ssl_server2.c
@@ -865,6 +865,10 @@ exit:
fflush( stdout ); getchar();
#endif
+ // Shell can not handle large exit numbers -> 1 for errors
+ if( ret < 0 )
+ ret = 1;
+
return( ret );
}
#endif /* POLARSSL_BIGNUM_C && POLARSSL_ENTROPY_C && POLARSSL_SSL_TLS_C &&