From 0f36e1ef7548476d8a06931995f98c0a1aef75af Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Mon, 2 Jul 2007 20:27:28 +0000 Subject: Fix building under Solaris. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72935 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/res_limit.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'res/res_limit.c') diff --git a/res/res_limit.c b/res/res_limit.c index 045f8db69..d8fe8513a 100644 --- a/res/res_limit.c +++ b/res/res_limit.c @@ -54,8 +54,10 @@ static struct limits { { RLIMIT_CORE, "-c", "core file size" }, #ifdef RLIMIT_RSS { RLIMIT_RSS, "-m", "resident memory" }, - { RLIMIT_NPROC, "-u", "number of processes" }, { RLIMIT_MEMLOCK, "-l", "amount of memory locked into RAM" }, +#endif +#ifdef RLIMIT_NPROC + { RLIMIT_NPROC, "-u", "number of processes" }, #endif { RLIMIT_NOFILE, "-n", "number of file descriptors" }, #ifdef VMEM_DEF @@ -107,7 +109,11 @@ static int my_ulimit(int fd, int argc, char **argv) if (argc == 3) { int x; +#ifdef RLIMIT_NPROC if (resource != RLIMIT_NOFILE && resource != RLIMIT_CORE && resource != RLIMIT_NPROC && resource != RLIMIT_FSIZE) { +#else + if (resource != RLIMIT_NOFILE && resource != RLIMIT_CORE && resource != RLIMIT_FSIZE) { +#endif ast_cli(fd, "Resource not permitted to be set\n"); return RESULT_FAILURE; } -- cgit v1.2.3