diff --git a/programs/ssl/ssl_fork_server.c b/programs/ssl/ssl_fork_server.c index 7624896a34..29a297c402 100644 --- a/programs/ssl/ssl_fork_server.c +++ b/programs/ssl/ssl_fork_server.c @@ -29,10 +29,13 @@ #include "mbedtls/platform.h" #else #include -#define mbedtls_fprintf fprintf -#define mbedtls_printf printf -#define mbedtls_time_t time_t -#endif +#include +#define mbedtls_fprintf fprintf +#define mbedtls_printf printf +#define mbedtls_time_t time_t +#define MBEDTLS_EXTI_SUCCESS EXIT_SUCCESS +#define MBEDTLS_EXIT_FAILURE EXIT_FAILURE +#endif /* MBEDTLS_PLATFORM_C */ #if !defined(MBEDTLS_BIGNUM_C) || !defined(MBEDTLS_CERTS_C) || \ !defined(MBEDTLS_ENTROPY_C) || !defined(MBEDTLS_SSL_TLS_C) || \ @@ -95,7 +98,8 @@ static void my_debug( void *ctx, int level, int main( void ) { - int ret, len, cnt = 0, pid; + int ret = 1, len, cnt = 0, pid; + int exit_code = MBEDTLS_EXIT_FAILURE; mbedtls_net_context listen_fd, client_fd; unsigned char buf[1024]; const char *pers = "ssl_fork_server"; @@ -392,6 +396,8 @@ int main( void ) goto exit; } + exit_code = MBEDTLS_EXIT_SUCCESS; + exit: mbedtls_net_free( &client_fd ); mbedtls_net_free( &listen_fd ); @@ -408,7 +414,7 @@ exit: fflush( stdout ); getchar(); #endif - return( ret ); + return( exit_code ); } #endif /* MBEDTLS_BIGNUM_C && MBEDTLS_CERTS_C && MBEDTLS_ENTROPY_C && MBEDTLS_SSL_TLS_C && MBEDTLS_SSL_SRV_C && MBEDTLS_NET_C &&