diff options
author | Steffan Karger | 2017-07-20 13:39:00 +0200 |
---|---|---|
committer | Gert Doering | 2017-07-20 14:18:07 +0200 |
commit | fd2a29ab2668fea9c0ac972d5ec69f00232c88b6 (patch) | |
tree | d2637328c9c45e83380fbc1c6efedf5718e4b5ce /src/openvpn/socket.c | |
parent | ad7f7e56d34bbf477a7e5639f1b78b2c7e58186c (diff) | |
download | openvpn-fd2a29ab2668fea9c0ac972d5ec69f00232c88b6.zip openvpn-fd2a29ab2668fea9c0ac972d5ec69f00232c88b6.tar.gz |
Remove strerror_ts()
This function was only called in string format functions, which already
copy the contents, so all this ever did was adding redundant malloc() and
free() calls.
Also, this wasn't as thread-safe as it claims: another thread could still
change the string value between the strerror() and buf_printf() calls. So,
instead of a not needed false sense of thread-safeness, just be honest and
use strerror() directly.
(I think we should find a better place for everything currently in misc.c,
and get rid of it all together. In this case, the better place is
/dev/null. This patch is part of that effort.)
Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1500550740-24773-1-git-send-email-steffan.karger@fox-it.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15105.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'src/openvpn/socket.c')
-rw-r--r-- | src/openvpn/socket.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index a814b95..846df04 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -1473,10 +1473,8 @@ socket_connect(socket_descriptor_t *sd, if (status) { - msg(D_LINK_ERRORS, - "TCP: connect to %s failed: %s", - print_sockaddr(dest, &gc), - strerror_ts(status, &gc)); + msg(D_LINK_ERRORS, "TCP: connect to %s failed: %s", + print_sockaddr(dest, &gc), strerror(status)); openvpn_close_socket(*sd); *sd = SOCKET_UNDEFINED; |