Check if the socket has been created successfully.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42766 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
ac80530495
commit
6c5757eedb
@ -185,12 +185,17 @@ create_socket(int family, int type, int protocol, net_socket_private** _socket)
|
||||
struct net_socket_private* socket = new(std::nothrow) net_socket_private;
|
||||
if (socket == NULL)
|
||||
return B_NO_MEMORY;
|
||||
status_t status = socket->InitCheck();
|
||||
if (status != B_OK) {
|
||||
delete socket;
|
||||
return status;
|
||||
}
|
||||
|
||||
socket->family = family;
|
||||
socket->type = type;
|
||||
socket->protocol = protocol;
|
||||
|
||||
status_t status = get_domain_protocols(socket);
|
||||
status = get_domain_protocols(socket);
|
||||
if (status != B_OK) {
|
||||
delete socket;
|
||||
return status;
|
||||
|
Loading…
Reference in New Issue
Block a user