From 1690d2f4ddac03b233361044b07d408fa0abdf8d Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 29 Jul 2015 14:22:22 -0400 Subject: [PATCH] BNetworkAddress: Fix review comments (again). Axel changed his mind about the status on Unset(), and I messed up the fStatus setters. --- src/kits/network/libnetapi/NetworkAddress.cpp | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/kits/network/libnetapi/NetworkAddress.cpp b/src/kits/network/libnetapi/NetworkAddress.cpp index 92986fb3d8..0556bb4268 100644 --- a/src/kits/network/libnetapi/NetworkAddress.cpp +++ b/src/kits/network/libnetapi/NetworkAddress.cpp @@ -151,7 +151,7 @@ BNetworkAddress::Unset() { fAddress.ss_family = AF_UNSPEC; fAddress.ss_len = 2; - fStatus = B_NO_INIT; + fStatus = B_OK; } @@ -177,10 +177,9 @@ BNetworkAddress::SetTo(const char* host, uint16 port, uint32 flags) cookie = 0; status = resolver->GetNextAddress(&cookie, *this); - if (status != B_OK) { + fStatus = status; + if (status != B_OK) Unset(); - fStatus = status; - } return status; } @@ -207,10 +206,9 @@ BNetworkAddress::SetTo(const char* host, const char* service, uint32 flags) cookie = 0; status = resolver->GetNextAddress(&cookie, *this); - if (status != B_OK) { + fStatus = status; + if (status != B_OK) Unset(); - fStatus = status; - } return status; } @@ -235,10 +233,9 @@ BNetworkAddress::SetTo(int family, const char* host, uint16 port, uint32 flags) uint32 cookie = 0; status = resolver->GetNextAddress(&cookie, *this); - if (status != B_OK) { + fStatus = status; + if (status != B_OK) Unset(); - fStatus = status; - } return status; } @@ -264,10 +261,9 @@ BNetworkAddress::SetTo(int family, const char* host, const char* service, uint32 cookie = 0; status = resolver->GetNextAddress(&cookie, *this); - if (status != B_OK) { + fStatus = status; + if (status != B_OK) Unset(); - fStatus = status; - } return status; }