aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_limit.c
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-16 02:42:53 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-16 02:42:53 +0000
commit22ccdccccee09665c4e49bc02476bef372d8ad22 (patch)
tree55705dd838c626e0396085012223574b789373c2 /res/res_limit.c
parentb68b240ef802a54356a84c0264665fdaf838a80a (diff)
prevent a compiler warning
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48512 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_limit.c')
-rw-r--r--res/res_limit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/res/res_limit.c b/res/res_limit.c
index 217858d67..4db463d6e 100644
--- a/res/res_limit.c
+++ b/res/res_limit.c
@@ -90,13 +90,14 @@ static int my_ulimit(int fd, int argc, char **argv)
}
if (argc == 3) {
+ int x;
if (resource != RLIMIT_NOFILE && resource != RLIMIT_CORE && resource != RLIMIT_NPROC && resource != RLIMIT_FSIZE) {
ast_cli(fd, "Resource not permitted to be set\n");
return RESULT_FAILURE;
}
- sscanf(argv[2], "%d", (int *)&rlimit.rlim_cur);
- rlimit.rlim_max = rlimit.rlim_cur;
+ sscanf(argv[2], "%d", &x);
+ rlimit.rlim_max = rlimit.rlim_cur = x;
setrlimit(resource, &rlimit);
return RESULT_SUCCESS;
} else {