1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2024-12-25 01:07:52 +00:00

Limit number of sessions to FD_SETSIZE

This commit is contained in:
M66B 2016-04-11 08:11:49 +02:00
parent c13032258c
commit c36ff9e420

View file

@ -68,6 +68,8 @@ void *handle_events(void *a) {
log_android(ANDROID_LOG_WARN, "getrlimit soft %d hard %d max sessions %d", log_android(ANDROID_LOG_WARN, "getrlimit soft %d hard %d max sessions %d",
rlim.rlim_cur, rlim.rlim_max, maxsessions); rlim.rlim_cur, rlim.rlim_max, maxsessions);
} }
if (maxsessions > FD_SETSIZE)
maxsessions = FD_SETSIZE;
// Block SIGUSR1 // Block SIGUSR1
sigemptyset(&blockset); sigemptyset(&blockset);