para_fd_set(sct->listen_fd, &s->rfds, &s->max_fileno);
}
-static void command_post_select(struct sched *s, struct task *t)
+static int command_post_select(struct sched *s, struct task *t)
{
struct server_command_task *sct = container_of(t, struct server_command_task, task);
if (child_pid) {
close(new_fd);
/* parent keeps accepting connections */
- return;
+ return 0;
}
/* mmd might already have changed at this point */
free(chunk_table);
for (i = sct->argc - 1; i >= 0; i--)
memset(sct->argv[i], 0, strlen(sct->argv[i]));
sprintf(sct->argv[0], "para_server (serving %s)", peer_name);
- return handle_connect(new_fd, peer_name);
+ handle_connect(new_fd, peer_name);
+ /* never reached*/
out:
if (ret < 0)
PARA_CRIT_LOG("%s\n", para_strerror(-ret));
+ return 0;
}
static void init_server_command_task(int argc, char **argv)
PARA_NOTICE_LOG("initializing tcp command socket\n");
sct->task.pre_select = command_pre_select;
- sct->task.post_select = command_post_select;
+ sct->task.new_post_select = command_post_select;
+ sct->task.post_select = NULL;
sct->argc = argc;
sct->argv = argv;
ret = para_listen_simple(IPPROTO_TCP, conf.port_arg);