mirror of https://github.com/wolfSSL/wolfssh.git
commit
626708de86
|
@ -86,17 +86,34 @@ typedef int SOCKET_T;
|
||||||
#define CYASSL_THREAD __stdcall
|
#define CYASSL_THREAD __stdcall
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
SOCKET_T clientFd;
|
SOCKET_T clientFd;
|
||||||
} thread_ctx_t;
|
} thread_ctx_t;
|
||||||
|
|
||||||
|
|
||||||
static INLINE void err_sys(const char* msg)
|
#ifdef __GNUC__
|
||||||
|
#define WS_NORETURN __attribute__((noreturn))
|
||||||
|
#else
|
||||||
|
#define WS_NORETURN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
static INLINE WS_NORETURN void err_sys(const char* msg)
|
||||||
{
|
{
|
||||||
printf("server error: %s\n", msg);
|
printf("server error: %s\n", msg);
|
||||||
|
|
||||||
|
#ifndef __GNUC__
|
||||||
|
/* scan-build (which pretends to be gnuc) can get confused and think the
|
||||||
|
* msg pointer can be null even when hardcoded and then it won't exit,
|
||||||
|
* making null pointer checks above the err_sys() call useless.
|
||||||
|
* We could just always exit() but some compilers will complain about no
|
||||||
|
* possible return, with gcc we know the attribute to handle that with
|
||||||
|
* WS_NORETURN. */
|
||||||
if (msg)
|
if (msg)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -669,4 +686,3 @@ int main(void)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,17 +84,34 @@ typedef int SOCKET_T;
|
||||||
#define CYASSL_THREAD __stdcall
|
#define CYASSL_THREAD __stdcall
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
SOCKET_T clientFd;
|
SOCKET_T clientFd;
|
||||||
} thread_ctx_t;
|
} thread_ctx_t;
|
||||||
|
|
||||||
|
|
||||||
static INLINE void err_sys(const char* msg)
|
#ifdef __GNUC__
|
||||||
|
#define WS_NORETURN __attribute__((noreturn))
|
||||||
|
#else
|
||||||
|
#define WS_NORETURN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
static INLINE WS_NORETURN void err_sys(const char* msg)
|
||||||
{
|
{
|
||||||
printf("server error: %s\n", msg);
|
printf("server error: %s\n", msg);
|
||||||
|
|
||||||
|
#ifndef __GNUC__
|
||||||
|
/* scan-build (which pretends to be gnuc) can get confused and think the
|
||||||
|
* msg pointer can be null even when hardcoded and then it won't exit,
|
||||||
|
* making null pointer checks above the err_sys() call useless.
|
||||||
|
* We could just always exit() but some compilers will complain about no
|
||||||
|
* possible return, with gcc we know the attribute to handle that with
|
||||||
|
* WS_NORETURN. */
|
||||||
if (msg)
|
if (msg)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue