Just to be consistent with mark_fd_blocking().
PARA_EMERG_LOG("can not listen on socket\n");
exit(EXIT_FAILURE);
}
- ret = mark_fd_nonblock(socket_fd);
+ ret = mark_fd_nonblocking(socket_fd);
if (ret < 0) {
close(socket_fd);
return ret;
goto out;
}
fd = t->ret;
- t->ret = mark_fd_nonblock(fd);
+ t->ret = mark_fd_nonblocking(fd);
if (t->ret < 0) {
PARA_NOTICE_LOG("%s\n", PARA_STRERROR(-t->ret));
close(fd);
exit(EXIT_FAILURE);
}
server_socket = socket_fd;
- ret = mark_fd_nonblock(server_socket);
+ ret = mark_fd_nonblocking(server_socket);
if (ret < 0)
exit(EXIT_FAILURE);
PARA_INFO_LOG("server_socket: %d, afs_socket_cookie: %u\n",
PARA_EMERG_LOG("can not listen on socket\n");
exit(EXIT_FAILURE); /* do not unlink socket */
}
- mark_fd_nonblock(fd);
+ mark_fd_nonblocking(fd);
return fd;
}
if (ret < 0)
goto err_out;
pcd->status = CL_CONNECTED;
- ret = mark_fd_nonblock(pcd->fd);
+ ret = mark_fd_nonblocking(pcd->fd);
if (ret < 0)
goto err_out;
pcd->task.pre_select = client_pre_select;
ret = -E_DCCP_CONNECT;
goto err_out;
}
- mark_fd_nonblock(pdd->fd);
+ mark_fd_nonblocking(pdd->fd);
return 1;
err_out:
dccp_recv_close(rn);
dc->fd = ret;
para_list_add(&dc->node, &clients);
add_close_on_fork_list(dc->fd);
- mark_fd_nonblock(dc->fd);
+ mark_fd_nonblocking(dc->fd);
dc->cq = cq_new(DCCP_MAX_PENDING_BYTES);
}
}
PARA_DEBUG_LOG("listening on fd %d\n", listen_fd);
add_close_on_fork_list(listen_fd);
- mark_fd_nonblock(listen_fd);
+ mark_fd_nonblocking(listen_fd);
return 1;
}
*
* \return Standard.
*/
-int mark_fd_nonblock(int fd)
+int mark_fd_nonblocking(int fd)
{
int flags = fcntl(fd, F_GETFL);
if (flags < 0)
int file_exists(const char *);
int para_select(int n, fd_set *readfds, fd_set *writefds,
struct timeval *timeout_tv);
-int mark_fd_nonblock(int fd);
+int mark_fd_nonblocking(int fd);
int mark_fd_blocking(int fd);
void para_fd_set(int fd, fd_set *fds, int *max_fileno);
__must_check int para_fgets(char *line, int size, FILE *f);
if (ret < 0)
return -1;
command_pipe = fds[1];
- mark_fd_nonblock(command_pipe);
+ mark_fd_nonblocking(command_pipe);
return send_output();
}
if (para_exec_cmdline_pid(&cmd_pid, cmd, fds) < 0)
return -1;
command_pipe = fds[1];
- mark_fd_nonblock(command_pipe);
+ mark_fd_nonblocking(command_pipe);
return send_output();
}
int ret = para_exec_cmdline_pid(&pid, cmd, fds);
if (ret < 0)
return ret;
- ret = mark_fd_nonblock(fds[1]);
+ ret = mark_fd_nonblocking(fds[1]);
if (ret > 0)
return fds[1];
close(fds[1]);
close(phd->fd);
goto err_out;
}
- mark_fd_nonblock(phd->fd);
+ mark_fd_nonblocking(phd->fd);
phd->status = HTTP_CONNECTED;
return 1;
err_out:
numclients++;
para_list_add(&hc->node, &clients);
add_close_on_fork_list(hc->fd);
- mark_fd_nonblock(hc->fd);
+ mark_fd_nonblocking(hc->fd);
return;
err_out:
PARA_WARNING_LOG("ignoring connect request from %s (%s)\n",
self->status = SENDER_OFF;
return server_fd;
}
- ret = mark_fd_nonblock(server_fd);
+ ret = mark_fd_nonblocking(server_fd);
if (ret < 0) {
PARA_EMERG_LOG("%s\n", PARA_STRERROR(-ret));
exit(EXIT_FAILURE);
if (ret < 0)
goto err;
fd = ret;
- ret = mark_fd_nonblock(fd);
+ ret = mark_fd_nonblocking(fd);
if (ret < 0)
goto err;
add_close_on_fork_list(fd); /* child doesn't need the listener */
}
close(afs_server_socket[1]);
afs_socket = afs_server_socket[0];
- ret = mark_fd_nonblock(afs_socket);
+ ret = mark_fd_nonblocking(afs_socket);
if (ret < 0)
exit(EXIT_FAILURE);
add_close_on_fork_list(afs_socket);
ret = -ERRNO_TO_PARA_ERROR(errno);
goto err_out;
}
- ret = mark_fd_nonblock(signal_pipe[0]);
+ ret = mark_fd_nonblocking(signal_pipe[0]);
if (ret < 0)
goto err_out;
- ret = mark_fd_nonblock(signal_pipe[1]);
+ ret = mark_fd_nonblocking(signal_pipe[1]);
if (ret < 0)
goto err_out;
return signal_pipe[0];
sit->task.post_select = stdin_post_select;
sit->task.event_handler = stdin_default_event_handler;
sit->task.private_data = sit;
- mark_fd_nonblock(STDIN_FILENO);
+ mark_fd_nonblocking(STDIN_FILENO);
sprintf(sit->task.status, "stdin reader");
}
sot->task.post_select = stdout_post_select;
sot->task.event_handler = stdout_default_event_handler;
sot->eof = 0;
- mark_fd_nonblock(STDOUT_FILENO);
+ mark_fd_nonblocking(STDOUT_FILENO);
sprintf(sot->task.status, "stdout writer");
}