Copied change to err_sys() from wolfSSL. Cleaned up a static analysis

issue. Also added the attribute noreturn to the function since it
doesn't actually return.
pull/15/head
John Safranek 2016-08-25 13:15:24 -07:00
parent 31b411bbed
commit 629cb8d160
2 changed files with 16 additions and 6 deletions

View File

@ -86,17 +86,22 @@ typedef int SOCKET_T;
#define CYASSL_THREAD __stdcall
#endif
#ifdef __GNUC__
#define NORETURN __attribute__((noreturn))
#else
#define NORETURN
#endif
typedef struct {
SOCKET_T clientFd;
} thread_ctx_t;
static INLINE void err_sys(const char* msg)
static INLINE NORETURN void err_sys(const char* msg)
{
printf("server error: %s\n", msg);
if (msg)
exit(EXIT_FAILURE);
exit(EXIT_FAILURE);
}

View File

@ -84,17 +84,22 @@ typedef int SOCKET_T;
#define CYASSL_THREAD __stdcall
#endif
#ifdef __GNUC__
#define NORETURN __attribute__((noreturn))
#else
#define NORETURN
#endif
typedef struct {
SOCKET_T clientFd;
} thread_ctx_t;
static INLINE void err_sys(const char* msg)
static INLINE NORETURN void err_sys(const char* msg)
{
printf("server error: %s\n", msg);
if (msg)
exit(EXIT_FAILURE);
exit(EXIT_FAILURE);
}