Skip to content

Commit

Permalink
Fix missing error codes when NO_SOCK and USER_IO are in use
Browse files Browse the repository at this point in the history
Functions in `wolfio.c` unconditionally reference SOCKET_* error
codes, even if `errno.h` is conditionally includes in wolfio.h.

When compiled with at least WOLFSSL_NO_SOCK + WOLFSSO_USER_IO
`wolfio.h` decides not to include `errno.h` and therefore SOCKET_* symbols
are missing.

Instead of changing "decision tree" in `wolfio.h` and
risking breaking it on platforms I couldn't test, use "last resort"
include of 'errno.h' in the wolfio.c if configure process detected
its presence.
  • Loading branch information
redbaron committed Nov 7, 2024
1 parent c577ad7 commit 4a4cb79
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/wolfio.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@

#include <wolfssl/wolfcrypt/settings.h>

#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif

#ifndef WOLFCRYPT_ONLY

#ifdef _WIN32_WCE
Expand Down

0 comments on commit 4a4cb79

Please sign in to comment.