aboutsummaryrefslogtreecommitdiff
path: root/src/jail.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/jail.c')
-rw-r--r--src/jail.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/jail.c b/src/jail.c
index 22c8ec2..04bfd21 100644
--- a/src/jail.c
+++ b/src/jail.c
@@ -18,7 +18,7 @@ typedef struct jail_prisoner_process {
char host_buf[NI_MAXHOST], service_buf[NI_MAXSERV];
} jail_prisoner_process;
-static int jail_daemonfn_epoll(int epoll_fd, jail_ctx *ctx[], size_t siz);
+static int jail_mainloop_epoll(int epoll_fd, jail_ctx *ctx[], size_t siz);
static int jail_accept_client(jail_ctx *ctx[],
size_t siz, struct epoll_event *event);
static int jail_childfn(void *arg);
@@ -115,13 +115,14 @@ int jail_setup_epoll(jail_ctx *ctx[], size_t siz)
return fd;
}
-pid_t jail_daemonize_epoll(int epoll_fd, jail_ctx *ctx[], size_t siz)
+pid_t jail_daemonize(int epoll_fd, jail_ctx *ctx[], size_t siz)
{
pid_t p;
int s;
size_t i;
assert(ctx);
+ assert(siz > 0);
for (i = 0; i < siz; ++i) {
assert(ctx[i]);
@@ -140,7 +141,7 @@ pid_t jail_daemonize_epoll(int epoll_fd, jail_ctx *ctx[], size_t siz)
return -1;
case 0:
N("%s", "Jail daemon mainloop");
- jail_daemonfn_epoll(epoll_fd, ctx, siz);
+ jail_mainloop_epoll(epoll_fd, ctx, siz);
break;
}
D2("Jail daemon pid: %d", p);
@@ -148,7 +149,7 @@ pid_t jail_daemonize_epoll(int epoll_fd, jail_ctx *ctx[], size_t siz)
return p;
}
-static int jail_daemonfn_epoll(int epoll_fd, jail_ctx *ctx[], size_t siz)
+static int jail_mainloop_epoll(int epoll_fd, jail_ctx *ctx[], size_t siz)
{
static struct epoll_event *events = NULL;
sigset_t eset;