goto out_close;
}
- if (listen(sock, 5) == -1) {
- DEBUG(0, ("listen failed on pipe socket %s: %s\n", path,
- strerror(errno)));
- goto out_close;
- }
-
SAFE_FREE(path);
umask(old_umask);
struct nb_packet_server *result;
struct tevent_fd *fde;
NTSTATUS status;
+ int rc;
result = talloc_zero(mem_ctx, struct nb_packet_server);
if (result == NULL) {
status = map_nt_error_from_unix(errno);
goto fail;
}
+ rc = listen(result->listen_sock, 5);
+ if (rc < 0) {
+ status = map_nt_error_from_unix(errno);
+ goto fail;
+ }
talloc_set_destructor(result, nb_packet_server_destructor);
fde = tevent_add_fd(ev, result, result->listen_sock, TEVENT_FD_READ,
{
struct dcerpc_ncacn_listen_state *state;
struct tevent_fd *fde;
+ int rc;
state = talloc(ev_ctx, struct dcerpc_ncacn_listen_state);
if (!state) {
goto out;
}
+ rc = listen(state->fd, 5);
+ if (rc < 0) {
+ DEBUG(0, ("Failed to listen on pipe socket %s: %s\n",
+ pipe_name, strerror(errno)));
+ goto out;
+ }
+
state->ev_ctx = ev_ctx;
state->msg_ctx = msg_ctx;
{
struct dcerpc_ncacn_listen_state *state;
struct tevent_fd *fde;
+ int rc;
state = talloc(ev_ctx, struct dcerpc_ncacn_listen_state);
if (state == NULL) {
goto out;
}
+ rc = listen(state->fd, 5);
+ if (rc < 0) {
+ DEBUG(0, ("Failed to listen on ncalrpc socket %s: %s\n",
+ name, strerror(errno)));
+ goto out;
+ }
+
state->ev_ctx = ev_ctx;
state->msg_ctx = msg_ctx;
struct winbindd_listen_state *pub_state = NULL;
struct winbindd_listen_state *priv_state = NULL;
struct tevent_fd *fde;
+ int rc;
pub_state = talloc(winbind_event_context(),
struct winbindd_listen_state);
if (pub_state->fd == -1) {
goto failed;
}
+ rc = listen(pub_state->fd, 5);
+ if (rc < 0) {
+ goto failed;
+ }
fde = tevent_add_fd(winbind_event_context(), pub_state, pub_state->fd,
TEVENT_FD_READ, winbindd_listen_fde_handler,
if (priv_state->fd == -1) {
goto failed;
}
+ rc = listen(priv_state->fd, 5);
+ if (rc < 0) {
+ goto failed;
+ }
fde = tevent_add_fd(winbind_event_context(), priv_state,
priv_state->fd, TEVENT_FD_READ,