mmd->active_connections = 0;
mmd->vss_status_flags = VSS_NEXT;
mmd->new_vss_status_flags = VSS_NEXT;
mmd->active_connections = 0;
mmd->vss_status_flags = VSS_NEXT;
mmd->new_vss_status_flags = VSS_NEXT;
if (OPT_GIVEN(LOGFILE)) {
daemon_set_logfile(OPT_STRING_VAL(LOGFILE));
daemon_open_log_or_die();
if (OPT_GIVEN(LOGFILE)) {
daemon_set_logfile(OPT_STRING_VAL(LOGFILE));
daemon_open_log_or_die();
- .pre_select = signal_pre_select,
- .post_select = signal_post_select,
+ .pre_monitor = signal_pre_monitor,
+ .post_monitor = signal_post_monitor,
- ret = para_accept(sct->listen_fds[listen_idx], &s->rfds, NULL, 0, &new_fd);
+ ret = para_accept(sct->listen_fds[listen_idx], NULL, 0, &new_fd);
/*
* After we return, the scheduler calls server_select() with a minimal
* timeout value, because the remaining tasks have a notification
/*
* After we return, the scheduler calls server_select() with a minimal
* timeout value, because the remaining tasks have a notification
* which will return negative in view of the notification. This causes
* schedule() to return as there are no more runnable tasks.
*
* Note that semaphores are not inherited across a fork(), so we don't
* which will return negative in view of the notification. This causes
* schedule() to return as there are no more runnable tasks.
*
* Note that semaphores are not inherited across a fork(), so we don't
- * hold the lock at this point. Since server_select() drops the lock
- * prior to calling para_select(), we need to acquire it here.
+ * hold the lock at this point. Since server_poll() drops the lock
+ * prior to calling poll(), we need to acquire it here.
for (n = 0; n < sct->num_listen_fds; n++) {
ret = command_task_accept(n, s, sct);
for (n = 0; n < sct->num_listen_fds; n++) {
ret = command_task_accept(n, s, sct);
ret = para_listen_simple(IPPROTO_TCP, port);
if (ret < 0)
goto err;
sct->listen_fds[0] = ret;
} else {
sct->num_listen_fds = OPT_GIVEN(LISTEN_ADDRESS);
ret = para_listen_simple(IPPROTO_TCP, port);
if (ret < 0)
goto err;
sct->listen_fds[0] = ret;
} else {
sct->num_listen_fds = OPT_GIVEN(LISTEN_ADDRESS);
for (n = 0; n < OPT_GIVEN(LISTEN_ADDRESS); n++) {
const char *arg;
arg = lls_string_val(n, OPT_RESULT(LISTEN_ADDRESS));
for (n = 0; n < OPT_GIVEN(LISTEN_ADDRESS); n++) {
const char *arg;
arg = lls_string_val(n, OPT_RESULT(LISTEN_ADDRESS));
sct->task = task_register(&(struct task_info) {
.name = "server command",
sct->task = task_register(&(struct task_info) {
.name = "server command",
- .pre_select = command_pre_select,
- .post_select = command_post_select,
+ .pre_monitor = command_pre_monitor,
+ .post_monitor = command_post_monitor,
daemon_drop_privileges_or_die(OPT_STRING_VAL(USER),
OPT_STRING_VAL(GROUP));
version_handle_flag("server", OPT_GIVEN(VERSION));
daemon_drop_privileges_or_die(OPT_STRING_VAL(USER),
OPT_STRING_VAL(GROUP));
version_handle_flag("server", OPT_GIVEN(VERSION));
-static int server_select(int max_fileno, fd_set *readfds, fd_set *writefds,
- struct timeval *timeout_tv)
+static int server_poll(struct pollfd *fds, nfds_t nfds, int timeout)
- ret = para_select(max_fileno + 1, readfds, writefds, timeout_tv);
+ ret = xpoll(fds, nfds, timeout);
struct server_command_task server_command_task_struct,
*sct = &server_command_task_struct;
struct server_command_task server_command_task_struct,
*sct = &server_command_task_struct;
deplete_close_on_fork_list();
if (ret < 0)
PARA_EMERG_LOG("%s\n", para_strerror(-ret));
deplete_close_on_fork_list();
if (ret < 0)
PARA_EMERG_LOG("%s\n", para_strerror(-ret));