suricata: guard RLIMIT_NPROC usage

Only use RLIMIT_NPROC when the platform exposes that resource limit constant.
pull/15601/head
Martin Rehak 2 months ago committed by Victor Julien
parent f34acfdeed
commit 2ce2ebcdba

@ -3225,7 +3225,7 @@ void SuricataPostInit(void)
#endif #endif
if (limit_nproc) { if (limit_nproc) {
#if defined(HAVE_SYS_RESOURCE_H) #if defined(HAVE_SYS_RESOURCE_H) && defined(RLIMIT_NPROC)
#ifdef linux #ifdef linux
if (geteuid() == 0) { if (geteuid() == 0) {
SCLogWarning("setrlimit has no effect when running as root."); SCLogWarning("setrlimit has no effect when running as root.");

Loading…
Cancel
Save