wrap getrlimit call in HAVE_GETRLIMIT; bz3291

This commit is contained in:
Damien Miller 2021-04-07 08:20:35 +10:00
parent 679bdc4a5c
commit f283a6c2e0

View File

@ -1495,8 +1495,10 @@ process_extended_limits(u_int32_t id)
debug("request %u: limits", id);
#ifdef HAVE_GETRLIMIT
if (getrlimit(RLIMIT_NOFILE, &rlim) != -1 && rlim.rlim_cur > 5)
nfiles = rlim.rlim_cur - 5; /* stdio(3) + syslog + spare */
#endif
if ((msg = sshbuf_new()) == NULL)
fatal_f("sshbuf_new failed");