diff options
author | Damien Miller <djm@mindrot.org> | 2021-04-07 08:20:35 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2021-04-07 08:20:59 +1000 |
commit | f283a6c2e0a9bd9369e18462acd00be56fbe5b0d (patch) | |
tree | b77aac9700a2467698a49d44b929d5fd74c0863e | |
parent | 679bdc4a5c9244f427a7aee9c14b0a0ed086da1f (diff) |
wrap getrlimit call in HAVE_GETRLIMIT; bz3291
-rw-r--r-- | sftp-server.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sftp-server.c b/sftp-server.c index cce52dbc..1f9997bd 100644 --- a/sftp-server.c +++ b/sftp-server.c @@ -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"); |