* err.h, err.c, sockets.c: Fix bug #23119: Reorder timeout error code to

stop it being treated as a fatal error.
This commit is contained in:
jifl 2008-05-09 12:14:23 +00:00
parent 40d4a8fc2f
commit a3bc6cd666
4 changed files with 37 additions and 34 deletions

View File

@ -22,6 +22,10 @@ HISTORY
++ Bugfixes: ++ Bugfixes:
2008-05-09 Jonathan Larmour
* err.h, err.c, sockets.c: Fix bug #23119: Reorder timeout error code to
stop it being treated as a fatal error.
2008-04-15 Simon Goldschmidt 2008-04-15 Simon Goldschmidt
* dhcp.c: fixed bug #22804: dhcp_stop doesn't clear NETIF_FLAG_DHCP * dhcp.c: fixed bug #22804: dhcp_stop doesn't clear NETIF_FLAG_DHCP
(flag now cleared) (flag now cleared)

View File

@ -44,17 +44,17 @@ static const char *err_strerr[] = {
"Ok.", /* ERR_OK 0 */ "Ok.", /* ERR_OK 0 */
"Out of memory error.", /* ERR_MEM -1 */ "Out of memory error.", /* ERR_MEM -1 */
"Buffer error.", /* ERR_BUF -2 */ "Buffer error.", /* ERR_BUF -2 */
"Routing problem.", /* ERR_RTE -3 */ "Timeout.", /* ERR_TIMEOUT -3 */
"Connection aborted.", /* ERR_ABRT -4 */ "Routing problem.", /* ERR_RTE -4 */
"Connection reset.", /* ERR_RST -5 */ "Connection aborted.", /* ERR_ABRT -5 */
"Connection closed.", /* ERR_CLSD -6 */ "Connection reset.", /* ERR_RST -6 */
"Not connected.", /* ERR_CONN -7 */ "Connection closed.", /* ERR_CLSD -7 */
"Illegal value.", /* ERR_VAL -8 */ "Not connected.", /* ERR_CONN -8 */
"Illegal argument.", /* ERR_ARG -9 */ "Illegal value.", /* ERR_VAL -9 */
"Address in use.", /* ERR_USE -10 */ "Illegal argument.", /* ERR_ARG -10 */
"Low-level netif error.", /* ERR_IF -11 */ "Address in use.", /* ERR_USE -11 */
"Already connected.", /* ERR_ISCONN -12 */ "Low-level netif error.", /* ERR_IF -12 */
"Timeout.", /* ERR_TIMEOUT -13 */ "Already connected.", /* ERR_ISCONN -13 */
"Operation in progress." /* ERR_INPROGRESS -14 */ "Operation in progress." /* ERR_INPROGRESS -14 */
}; };

View File

@ -128,17 +128,17 @@ static const int err_to_errno_table[] = {
0, /* ERR_OK 0 No error, everything OK. */ 0, /* ERR_OK 0 No error, everything OK. */
ENOMEM, /* ERR_MEM -1 Out of memory error. */ ENOMEM, /* ERR_MEM -1 Out of memory error. */
ENOBUFS, /* ERR_BUF -2 Buffer error. */ ENOBUFS, /* ERR_BUF -2 Buffer error. */
EHOSTUNREACH, /* ERR_RTE -3 Routing problem. */ ETIMEDOUT, /* ERR_TIMEOUT -3 Timeout */
ECONNABORTED, /* ERR_ABRT -4 Connection aborted. */ EHOSTUNREACH, /* ERR_RTE -4 Routing problem. */
ECONNRESET, /* ERR_RST -5 Connection reset. */ ECONNABORTED, /* ERR_ABRT -5 Connection aborted. */
ESHUTDOWN, /* ERR_CLSD -6 Connection closed. */ ECONNRESET, /* ERR_RST -6 Connection reset. */
ENOTCONN, /* ERR_CONN -7 Not connected. */ ESHUTDOWN, /* ERR_CLSD -7 Connection closed. */
EINVAL, /* ERR_VAL -8 Illegal value. */ ENOTCONN, /* ERR_CONN -8 Not connected. */
EIO, /* ERR_ARG -9 Illegal argument. */ EINVAL, /* ERR_VAL -9 Illegal value. */
EADDRINUSE, /* ERR_USE -10 Address in use. */ EIO, /* ERR_ARG -10 Illegal argument. */
-1, /* ERR_IF -11 Low-level netif error */ EADDRINUSE, /* ERR_USE -11 Address in use. */
-1, /* ERR_ISCONN -12 Already connected. */ -1, /* ERR_IF -12 Low-level netif error */
ETIMEDOUT, /* ERR_TIMEOUT -13 Timeout */ -1, /* ERR_ISCONN -13 Already connected. */
EINPROGRESS /* ERR_INPROGRESS -14 Operation in progress */ EINPROGRESS /* ERR_INPROGRESS -14 Operation in progress */
}; };

View File

@ -45,25 +45,24 @@ typedef s8_t err_t;
#define ERR_OK 0 /* No error, everything OK. */ #define ERR_OK 0 /* No error, everything OK. */
#define ERR_MEM -1 /* Out of memory error. */ #define ERR_MEM -1 /* Out of memory error. */
#define ERR_BUF -2 /* Buffer error. */ #define ERR_BUF -2 /* Buffer error. */
#define ERR_RTE -3 /* Routing problem. */ #define ERR_TIMEOUT -3 /* Timeout. */
#define ERR_RTE -4 /* Routing problem. */
#define ERR_IS_FATAL(e) ((e) < ERR_RTE) #define ERR_IS_FATAL(e) ((e) < ERR_RTE)
#define ERR_ABRT -4 /* Connection aborted. */ #define ERR_ABRT -5 /* Connection aborted. */
#define ERR_RST -5 /* Connection reset. */ #define ERR_RST -6 /* Connection reset. */
#define ERR_CLSD -6 /* Connection closed. */ #define ERR_CLSD -7 /* Connection closed. */
#define ERR_CONN -7 /* Not connected. */ #define ERR_CONN -8 /* Not connected. */
#define ERR_VAL -8 /* Illegal value. */ #define ERR_VAL -9 /* Illegal value. */
#define ERR_ARG -9 /* Illegal argument. */ #define ERR_ARG -10 /* Illegal argument. */
#define ERR_USE -10 /* Address in use. */ #define ERR_USE -11 /* Address in use. */
#define ERR_IF -11 /* Low-level netif error */ #define ERR_IF -12 /* Low-level netif error */
#define ERR_ISCONN -12 /* Already connected. */ #define ERR_ISCONN -13 /* Already connected. */
#define ERR_TIMEOUT -13 /* Timeout. */
#define ERR_INPROGRESS -14 /* Operation in progress */ #define ERR_INPROGRESS -14 /* Operation in progress */