Skip to content

Commit

Permalink
Merge pull request #802 from skliper/fix793-socket-dead-code
Browse files Browse the repository at this point in the history
Fix #793, Remove unreachable code in OS_SocketOpen_Impl for BSD socket
  • Loading branch information
astrogeco authored Feb 12, 2021
2 parents e882996 + 15ab294 commit c878647
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions src/os/portable/os-impl-bsd-sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,23 +126,14 @@ int32 OS_SocketOpen_Impl(const OS_object_token_t *token)
return OS_ERR_NOT_IMPLEMENTED;
}

switch (stream->socket_domain)
/* Only AF_INET* at this point, can add cases if support is expanded */
switch (stream->socket_type)
{
case OS_SocketDomain_INET:
case OS_SocketDomain_INET6:
switch (stream->socket_type)
{
case OS_SocketType_DATAGRAM:
os_proto = IPPROTO_UDP;
break;
case OS_SocketType_STREAM:
os_proto = IPPROTO_TCP;
break;
default:
break;
}
case OS_SocketType_DATAGRAM:
os_proto = IPPROTO_UDP;
break;
default:
case OS_SocketType_STREAM:
os_proto = IPPROTO_TCP;
break;
}

Expand Down

0 comments on commit c878647

Please sign in to comment.