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; }