From 515e4b9187d5b40e4e036e7d25e0b7d8f805dd8d Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Thu, 20 Feb 2014 22:23:40 +0100 Subject: [PATCH] fixed bug #39882 No function shall set errno to 0 --- CHANGELOG | 3 +++ src/api/sockets.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 2682b9f4..c42f4602 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -96,6 +96,9 @@ HISTORY ++ Bugfixes: + 2014-02-20: Simon Goldschmidt + * sockets.c: fixed bug #39882 No function shall set errno to 0 + 2014-02-20: Simon Goldschmidt * mib_structs.c: fixed bug #40050 SNMP problem with MIB arrays > 255 diff --git a/src/api/sockets.c b/src/api/sockets.c index fda702ac..e77bb8b4 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -225,7 +225,7 @@ static const int err_to_errno_table[] = { #ifdef ERRNO #ifndef set_errno -#define set_errno(err) errno = (err) +#define set_errno(err) do { if (err) { errno = (err); } } while(0) #endif #else /* ERRNO */ #define set_errno(err)