static void conn_plain_read_shutdown_cb(rb_fde_t *fd, void *data);
-#ifndef _WIN32
static void
dummy_handler(int sig)
{
return;
}
-#endif
static void
setup_signals()
{
-#ifndef _WIN32
struct sigaction act;
act.sa_flags = 0;
act.sa_handler = dummy_handler;
sigaction(SIGALRM, &act, 0);
-#endif
}
static int
maxconn(void)
{
-#if defined(RLIMIT_NOFILE) && defined(HAVE_SYS_RESOURCE_H)
struct rlimit limit;
if(!getrlimit(RLIMIT_NOFILE, &limit))
{
return limit.rlim_cur;
}
-#endif /* RLIMIT_FD_MAX */
return MAXCONNECTIONS;
}
main(int argc, char **argv)
{
const char *s_ctlfd, *s_pipe, *s_pid;
- int ctlfd, pipefd, maxfd;
+ int ctlfd, pipefd, maxfd, x;
maxfd = maxconn();
s_ctlfd = getenv("CTL_FD");
pipefd = atoi(s_pipe);
ppid = atoi(s_pid);
-#ifndef _WIN32
- int x = 0;
for(x = 0; x < maxfd; x++)
{
if(x != ctlfd && x != pipefd && x > 2)
if(x > 2)
close(x);
}
-#endif
+
setup_signals();
rb_lib_init(NULL, NULL, NULL, 0, maxfd, 1024, 4096);
rb_linebuf_init(4096);