mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-05 20:55:46 +03:00
BUG 97: Remove obsolete hsterror().
This function is pretty much obsolete on most platforms. The standard errno should be used. If it is not enough on Windows we should use WSAGetLastError() in future.
This commit is contained in:
@@ -117,12 +117,6 @@ if (UNIX)
|
|||||||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} socket)
|
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} socket)
|
||||||
endif (HAVE_LIBSOCKET)
|
endif (HAVE_LIBSOCKET)
|
||||||
|
|
||||||
# libresolv
|
|
||||||
check_library_exists(resolv hstrerror "" HAVE_LIBRESOLV)
|
|
||||||
if (HAVE_LIBRESOLV)
|
|
||||||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} resolv)
|
|
||||||
endif (HAVE_LIBRESOLV)
|
|
||||||
|
|
||||||
# libnsl/inet_pton (Solaris)
|
# libnsl/inet_pton (Solaris)
|
||||||
check_library_exists(nsl inet_pton "" HAVE_LIBNSL)
|
check_library_exists(nsl inet_pton "" HAVE_LIBNSL)
|
||||||
if (HAVE_LIBNSL)
|
if (HAVE_LIBNSL)
|
||||||
|
13
src/bind.c
13
src/bind.c
@@ -61,17 +61,6 @@
|
|||||||
|
|
||||||
#define SOCKOPT_TYPE_ARG4 char
|
#define SOCKOPT_TYPE_ARG4 char
|
||||||
|
|
||||||
/*
|
|
||||||
* We need to provide hstrerror. Not we can't call the parameter h_errno
|
|
||||||
* because it's #defined
|
|
||||||
*/
|
|
||||||
static char *hstrerror(int h_errno_val) {
|
|
||||||
static char text[50] = {0};
|
|
||||||
|
|
||||||
snprintf(text, sizeof(text), "getaddrino error %d\n", h_errno_val);
|
|
||||||
|
|
||||||
return text;
|
|
||||||
}
|
|
||||||
#else /* _WIN32 */
|
#else /* _WIN32 */
|
||||||
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
@@ -118,7 +107,7 @@ static socket_t bind_socket(ssh_bind sshbind, const char *hostname,
|
|||||||
ssh_set_error(sshbind,
|
ssh_set_error(sshbind,
|
||||||
SSH_FATAL,
|
SSH_FATAL,
|
||||||
"Setting socket options failed: %s",
|
"Setting socket options failed: %s",
|
||||||
hstrerror(h_errno));
|
strerror(errno));
|
||||||
freeaddrinfo (ai);
|
freeaddrinfo (ai);
|
||||||
close(s);
|
close(s);
|
||||||
return -1;
|
return -1;
|
||||||
|
Reference in New Issue
Block a user