[haiku-commits] Re: haiku: hrev49468 - in src: kits/network/libnetapi apps/screenshot

  • From: gus knight <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 28 Jul 2015 15:08:08 -0400

On Tue, Jul 28, 2015 at 2:54 PM, Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> wrote:

On second thought, B_NO_INIT doesn't make any sense for BNetworkAddress. An
empty address is still a valid address (unlike a BFile object that hasn't
been initialized yet).

You wrote the original class, maybe at this point you should sit down
and decide what you really wanted to do? This'll be the fourth
revision of this commit...

@@ -177,8 +177,10 @@ BNetworkAddress::SetTo(const char* host, uint16 port,
uint32 flags)

cookie = 0;
status = resolver->GetNextAddress(&cookie, *this);
- if (status == B_OK)
- fStatus = B_OK;
+ if (status != B_OK) {
+ Unset();
+ fStatus = status;
+ }


If fStatus was not B_OK, it's still not B_OK after this, but should be.
Correct would be:
fStatus = ...
if (fStatus != B_OK)
_Unset();
return fStatus;


You're right about this. But as noted above -- do you have time to
"really" fix this class or should I?

-gus

Other related posts: