Minor style change.
Change-Id: Ib1f89bff55506cf3881047dd876adbf97c789423
diff --git a/client/NetdClient.cpp b/client/NetdClient.cpp
index f499f2a..68f1f31 100644
--- a/client/NetdClient.cpp
+++ b/client/NetdClient.cpp
@@ -63,8 +63,7 @@
}
if (FwmarkClient::shouldSetFwmark(family)) {
FwmarkCommand command = {FwmarkCommand::ON_ACCEPT, 0};
- int error = FwmarkClient().send(&command, sizeof(command), acceptedSocket);
- if (error) {
+ if (int error = FwmarkClient().send(&command, sizeof(command), acceptedSocket)) {
return closeFdAndSetErrno(acceptedSocket, error);
}
}
@@ -74,8 +73,7 @@
int netdClientConnect(int sockfd, const sockaddr* addr, socklen_t addrlen) {
if (sockfd >= 0 && addr && FwmarkClient::shouldSetFwmark(addr->sa_family)) {
FwmarkCommand command = {FwmarkCommand::ON_CONNECT, 0};
- int error = FwmarkClient().send(&command, sizeof(command), sockfd);
- if (error) {
+ if (int error = FwmarkClient().send(&command, sizeof(command), sockfd)) {
errno = -error;
return -1;
}
@@ -90,8 +88,7 @@
}
unsigned netId = netIdForProcess;
if (netId != NETID_UNSET && FwmarkClient::shouldSetFwmark(domain)) {
- int error = setNetworkForSocket(netId, socketFd);
- if (error) {
+ if (int error = setNetworkForSocket(netId, socketFd)) {
return closeFdAndSetErrno(socketFd, error);
}
}