prevent a compiler warning
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48512 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
b68b240ef8
commit
22ccdcccce
|
@ -90,13 +90,14 @@ static int my_ulimit(int fd, int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argc == 3) {
|
if (argc == 3) {
|
||||||
|
int x;
|
||||||
if (resource != RLIMIT_NOFILE && resource != RLIMIT_CORE && resource != RLIMIT_NPROC && resource != RLIMIT_FSIZE) {
|
if (resource != RLIMIT_NOFILE && resource != RLIMIT_CORE && resource != RLIMIT_NPROC && resource != RLIMIT_FSIZE) {
|
||||||
ast_cli(fd, "Resource not permitted to be set\n");
|
ast_cli(fd, "Resource not permitted to be set\n");
|
||||||
return RESULT_FAILURE;
|
return RESULT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
sscanf(argv[2], "%d", (int *)&rlimit.rlim_cur);
|
sscanf(argv[2], "%d", &x);
|
||||||
rlimit.rlim_max = rlimit.rlim_cur;
|
rlimit.rlim_max = rlimit.rlim_cur = x;
|
||||||
setrlimit(resource, &rlimit);
|
setrlimit(resource, &rlimit);
|
||||||
return RESULT_SUCCESS;
|
return RESULT_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
|
|
Reference in New Issue