aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2018-05-07 11:04:58 +0200
committerToni Uhlig <matzeton@googlemail.com>2018-05-07 11:04:58 +0200
commitbe4352e2bb6ffcc1d548cf9e8cf9f497e2865af0 (patch)
treed692109ddb4b9304ecc65be09e9cd44481551580 /src/main.c
parent14d2b4d0134ac00a6262d5c8229ffe0d3b5ecd48 (diff)
POTD skeleton #44.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index 0e4a1e1..91b8002 100644
--- a/src/main.c
+++ b/src/main.c
@@ -23,7 +23,8 @@ int main(int argc, char *argv[])
server_ctx *srv[srv_siz];
jail_ctx *jail[jail_siz];
forward_ctx *ssh_fwd = NULL;
- int jail_epoll_fd, srv_epoll_fd, proc_status;
+ event_ctx *srv_event = NULL;
+ int jail_epoll_fd, proc_status;
pid_t daemon_pid, srv_pid, jail_pid, wpid;
(void) argc;
@@ -89,17 +90,16 @@ int main(int argc, char *argv[])
"Server validation" );
}
- D2("%s", "Server epoll setup");
- srv_epoll_fd = server_setup_epoll( srv, srv_siz );
- D2("Server epoll fd: %d", srv_epoll_fd);
- ABORT_ON_FATAL( srv_epoll_fd < 0, "Server epoll setup" );
+ D2("%s", "Server event setup");
+ ABORT_ON_FATAL( server_setup_event( srv, srv_siz, &srv_event ),
+ "Server event setup" );
D2("Server dropping privileges to %s:%s", "nobody", "NULL");
ABORT_ON_FATAL( change_user_group("nobody", NULL),
"Server dropping privileges" );
N("%s", "Server epoll mainloop");
- srv_pid = server_daemonize( srv_epoll_fd, srv, srv_siz );
+ srv_pid = server_daemonize( srv_event, srv, srv_siz );
ABORT_ON_FATAL( srv_pid < 1, "Server epoll mainloop" );
while (1) {