From 5c8d48ae787ad6617a256e8dfdda95870a8e5994 Mon Sep 17 00:00:00 2001 From: Greg Kaiser Date: Fri, 11 Dec 2020 06:54:54 -0800 Subject: [PATCH] Remove unused 'err' assignment This was a little confusing because a quick glance suggested that 'err' was getting the value of getsockopt(), when actually it was getting the result of the '<' operation. Since 'err' wasn't being used, we clarify by just removing it altogether. Test: TreeHugger Change-Id: I1ff80812b460973e9d512a558623e0c44c2ecf09 --- libc/bionic/bind.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libc/bionic/bind.cpp b/libc/bionic/bind.cpp index 314b0a11f..c75a5647a 100644 --- a/libc/bionic/bind.cpp +++ b/libc/bionic/bind.cpp @@ -41,9 +41,9 @@ extern "C" int __bind(int fd, const struct sockaddr* addr, socklen_t addr_length int bind(int fd, const struct sockaddr* addr, socklen_t addr_length) { if (should_apply_soft_mac_bind_restrictions()) { - int sock_protocol, err; + int sock_protocol; socklen_t sock_length = sizeof(sock_protocol); - if ((err = getsockopt(fd, SOL_SOCKET, SO_PROTOCOL, &sock_protocol, &sock_length) < 0)) { + if (getsockopt(fd, SOL_SOCKET, SO_PROTOCOL, &sock_protocol, &sock_length) < 0) { async_safe_format_log(ANDROID_LOG_ERROR, "mac-restrictions", "Could not get socket protocol: %s", strerror(errno)); } else if (NETLINK_ROUTE == sock_protocol) {