From: Ben Pfaff Date: Mon, 19 Nov 2012 23:56:47 +0000 (-0800) Subject: socket-util: Remove get_socket_error(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24f974c481bc5230552b23d96312f645f7533cd3;p=openvswitch socket-util: Remove get_socket_error(). It has no remaining users. Signed-off-by: Ben Pfaff Acked-by: Ethan Jackson --- diff --git a/lib/socket-util.c b/lib/socket-util.c index 4843cc54..48f42f19 100644 --- a/lib/socket-util.c +++ b/lib/socket-util.c @@ -205,19 +205,6 @@ lookup_hostname(const char *host_name, struct in_addr *addr) : EINVAL); } -/* Returns the error condition associated with socket 'fd' and resets the - * socket's error status. */ -int -get_socket_error(int fd) -{ - int error; - - if (getsockopt_int(fd, SOL_SOCKET, SO_ERROR, "SO_ERROR", &error)) { - error = errno; - } - return error; -} - int check_connection_completion(int fd) { diff --git a/lib/socket-util.h b/lib/socket-util.h index a00b32e5..5bf85297 100644 --- a/lib/socket-util.h +++ b/lib/socket-util.h @@ -36,7 +36,6 @@ int lookup_ipv6(const char *host_name, struct in6_addr *address); int lookup_hostname(const char *host_name, struct in_addr *); -int get_socket_error(int sock); int get_socket_rcvbuf(int sock); int check_connection_completion(int fd); int drain_rcvbuf(int fd); diff --git a/python/ovs/socket_util.py b/python/ovs/socket_util.py index e6b6fcef..8fecbc79 100644 --- a/python/ovs/socket_util.py +++ b/python/ovs/socket_util.py @@ -133,12 +133,6 @@ def inet_open_active(style, target, default_port, dscp): return get_exception_errno(e), None -def get_socket_error(sock): - """Returns the errno value associated with 'socket' (0 if no error) and - resets the socket's error status.""" - return sock.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR) - - def get_exception_errno(e): """A lot of methods on Python socket objects raise socket.error, but that exception is documented as having two completely different forms of