From bf82344e3b3364a2c90e984d9d427e4cfcd1d3c6 Mon Sep 17 00:00:00 2001 From: bol-van Date: Mon, 14 Oct 2024 15:01:53 +0300 Subject: [PATCH] tpws: fix regression --- tpws/tpws.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tpws/tpws.c b/tpws/tpws.c index eda38c5..a9a1cc3 100644 --- a/tpws/tpws.c +++ b/tpws/tpws.c @@ -1156,7 +1156,7 @@ static bool read_system_maxfiles(rlim_t *maxfile) return false; n=fscanf(F,"%ju",&um); fclose(F); - if (!n) return false; + if (n != 1) return false; *maxfile = (rlim_t)um; return true; #elif defined(BSD) @@ -1201,7 +1201,7 @@ static bool set_ulimit(void) // additional 1/2 for unpaired remote legs sending buffers // 16 for listen_fd, epoll, hostlist, ... #ifdef SPLICE_PRESENT - fdmax = (params.nosplice ? 2 : (params.tamper && !params.tamper_lim ? 4 : 6)) * params.maxconn; + fdmax = (rlim_t)(params.nosplice ? 2 : (params.tamper && !params.tamper_lim ? 4 : 6)) * (rlim_t)params.maxconn; #else fdmax = 2 * params.maxconn; #endif