mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
s3:rpc_server: simplify the error checking of create_tcpip_socket() callers
create_tcpip_socket() never returns a valid fd and left port as 0. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
parent
b52d58d6e1
commit
5ed7ee7279
@ -61,11 +61,8 @@ NTSTATUS rpc_create_tcpip_sockets(const struct ndr_interface_table *iface,
|
||||
int fd;
|
||||
|
||||
fd = create_tcpip_socket(ifss, &p);
|
||||
if (fd < 0 || p == 0) {
|
||||
if (fd < 0) {
|
||||
status = NT_STATUS_UNSUCCESSFUL;
|
||||
if (fd != -1) {
|
||||
close(fd);
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
listen_fd[*listen_fd_size] = fd;
|
||||
@ -125,11 +122,8 @@ NTSTATUS rpc_create_tcpip_sockets(const struct ndr_interface_table *iface,
|
||||
}
|
||||
|
||||
fd = create_tcpip_socket(&ss, &p);
|
||||
if (fd < 0 || p == 0) {
|
||||
if (fd < 0) {
|
||||
status = NT_STATUS_UNSUCCESSFUL;
|
||||
if (fd != -1) {
|
||||
close(fd);
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
listen_fd[*listen_fd_size] = fd;
|
||||
|
Loading…
x
Reference in New Issue
Block a user