mirror of https://github.com/wolfSSL/wolfssh.git
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
parent
31b411bbed
commit
629cb8d160
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue