diff options
author | Heiko Hund | 2012-07-17 18:25:16 +0200 |
---|---|---|
committer | David Sommerseth | 2012-07-19 21:20:39 +0200 |
commit | 910675de28956cf8d028aed727486b64747362fb (patch) | |
tree | c42b15a45e8056baea13ea6d5bb3d3b08a63292e /src/openvpn/error.c | |
parent | 9081e0ad4c496a0334a21fc4e8e4f1f73a470b5a (diff) | |
download | openvpn-910675de28956cf8d028aed727486b64747362fb.zip openvpn-910675de28956cf8d028aed727486b64747362fb.tar.gz |
don't treat socket related errors special anymore
WSAGetLastError() is just a wrapper for GetLastError(). So, there's
no need to differentiate between socket related and other errors.
This patch removes all special handling of socket errors in favor
of simplifying the codebase somewhat.
Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1342542316-32563-1-git-send-email-heiko.hund@sophos.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6876
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Diffstat (limited to 'src/openvpn/error.c')
-rw-r--r-- | src/openvpn/error.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/openvpn/error.c b/src/openvpn/error.c index d6ad639..8396fe0 100644 --- a/src/openvpn/error.c +++ b/src/openvpn/error.c @@ -221,10 +221,7 @@ void x_msg (const unsigned int flags, const char *format, ...) return; #endif - if (flags & M_ERRNO_SOCK) - e = openvpn_errno_socket (); - else - e = openvpn_errno (); + e = openvpn_errno (); /* * Apply muting filter. @@ -245,7 +242,7 @@ void x_msg (const unsigned int flags, const char *format, ...) va_end (arglist); m1[ERR_BUF_SIZE - 1] = 0; /* windows vsnprintf needs this */ - if ((flags & (M_ERRNO|M_ERRNO_SOCK)) && e) + if ((flags & M_ERRNO) && e) { openvpn_snprintf (m2, ERR_BUF_SIZE, "%s: %s (errno=%d)", m1, strerror_ts (e, &gc), e); @@ -596,7 +593,7 @@ x_check_status (int status, struct link_socket *sock, struct tuntap *tt) { - const int my_errno = (sock ? openvpn_errno_socket () : (int)openvpn_errno ()); + const int my_errno = openvpn_errno (); const char *extended_msg = NULL; msg (x_cs_verbose_level, "%s %s returned %d", |