Skip to content

Commit

Permalink
Fix return value error
Browse files Browse the repository at this point in the history
  • Loading branch information
madhurajayaraman committed Oct 25, 2024
1 parent b390a53 commit 88a335e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions starboard/shared/starboard/link_receiver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ int CreateLocallyBoundSocket(SbSocketAddressType address_type, int port) {
SB_LOG(ERROR) << __FUNCTION__ << ": Bind failed. errno=" << errno;
return -1;
}

return socket_fd;
}

Expand All @@ -160,7 +159,7 @@ int CreateListeningSocket(SbSocketAddressType address_type, int port) {
return -1;
}

return -1;
return socket_fd;
}

// Gets the port socket is bound to.
Expand Down Expand Up @@ -335,14 +334,15 @@ void LinkReceiver::Impl::Run() {
waiter_initialized_.Put();
return;
}
listen_socket_ = -1;

listen_socket_ =
CreateListeningSocket(kSbSocketAddressTypeIpv4, specified_port_);
if (!listen_socket_ || listen_socket_ < 0) {
if (listen_socket_ < 0) {
listen_socket_ =
CreateListeningSocket(kSbSocketAddressTypeIpv6, specified_port_);
}
if (!listen_socket_ || listen_socket_ < 0) {
if (listen_socket_ < 0) {
SB_LOG(WARNING) << "Unable to start LinkReceiver on port "
<< specified_port_ << ".";
SbSocketWaiterDestroy(waiter_);
Expand Down

0 comments on commit 88a335e

Please sign in to comment.