mirror of https://github.com/wolfSSL/wolfssh.git
commit
626708de86
|
@ -86,18 +86,35 @@ typedef int SOCKET_T;
|
|||
#define CYASSL_THREAD __stdcall
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct {
|
||||
SOCKET_T clientFd;
|
||||
} 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);
|
||||
|
||||
#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)
|
||||
#endif
|
||||
{
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static INLINE void build_addr(SOCKADDR_IN_T* addr, const char* peer,
|
||||
|
@ -669,4 +686,3 @@ int main(void)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -84,18 +84,35 @@ typedef int SOCKET_T;
|
|||
#define CYASSL_THREAD __stdcall
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct {
|
||||
SOCKET_T clientFd;
|
||||
} 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);
|
||||
|
||||
#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)
|
||||
#endif
|
||||
{
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static INLINE void build_addr(SOCKADDR_IN_T* addr, const char* peer,
|
||||
|
|
Loading…
Reference in New Issue