mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-24 23:48:09 +00:00
Fix ret code in udp_proxy.c
This commit is contained in:
parent
57a0c9b62c
commit
80081a68cd
1 changed files with 12 additions and 7 deletions
|
@ -40,7 +40,9 @@
|
||||||
#define mbedtls_time time
|
#define mbedtls_time time
|
||||||
#define mbedtls_time_t time_t
|
#define mbedtls_time_t time_t
|
||||||
#define mbedtls_printf printf
|
#define mbedtls_printf printf
|
||||||
#endif
|
#define MBEDTLS_EXTI_SUCCESS EXIT_SUCCESS
|
||||||
|
#define MBEDTLS_EXIT_FAILURE EXIT_FAILURE
|
||||||
|
#endif /* MBEDTLS_PLATFORM_C */
|
||||||
|
|
||||||
#if !defined(MBEDTLS_NET_C)
|
#if !defined(MBEDTLS_NET_C)
|
||||||
int main( void )
|
int main( void )
|
||||||
|
@ -600,7 +602,8 @@ int handle_message( const char *way,
|
||||||
|
|
||||||
int main( int argc, char *argv[] )
|
int main( int argc, char *argv[] )
|
||||||
{
|
{
|
||||||
int ret;
|
int ret = 1;
|
||||||
|
int exit_code = MBEDTLS_EXIT_FAILURE;
|
||||||
|
|
||||||
mbedtls_net_context listen_fd, client_fd, server_fd;
|
mbedtls_net_context listen_fd, client_fd, server_fd;
|
||||||
|
|
||||||
|
@ -781,10 +784,12 @@ accept:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exit_code = MBEDTLS_EXIT_SUCCESS;
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
|
||||||
#ifdef MBEDTLS_ERROR_C
|
#ifdef MBEDTLS_ERROR_C
|
||||||
if( ret != 0 )
|
if( exit_code != MBEDTLS_EXIT_SUCCESS )
|
||||||
{
|
{
|
||||||
char error_buf[100];
|
char error_buf[100];
|
||||||
mbedtls_strerror( ret, error_buf, 100 );
|
mbedtls_strerror( ret, error_buf, 100 );
|
||||||
|
@ -802,7 +807,7 @@ exit:
|
||||||
fflush( stdout ); getchar();
|
fflush( stdout ); getchar();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return( ret != 0 );
|
return( exit_code );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* MBEDTLS_NET_C */
|
#endif /* MBEDTLS_NET_C */
|
||||||
|
|
Loading…
Reference in a new issue