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
diff --git a/libc/bionic/bind.cpp b/libc/bionic/bind.cpp
index 314b0a1..c75a564 100644
--- a/libc/bionic/bind.cpp
+++ b/libc/bionic/bind.cpp
@@ -41,9 +41,9 @@
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) {