mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-24 06:53:41 +00:00
Merge "astfd: With RLIMIT_NOFILE only the current value is sensible."
This commit is contained in:
@@ -276,10 +276,10 @@ static char *handle_show_fd(struct ast_cli_entry *e, int cmd, struct ast_cli_arg
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
getrlimit(RLIMIT_NOFILE, &rl);
|
getrlimit(RLIMIT_NOFILE, &rl);
|
||||||
if (rl.rlim_cur == RLIM_INFINITY || rl.rlim_max == RLIM_INFINITY) {
|
if (rl.rlim_cur == RLIM_INFINITY) {
|
||||||
ast_copy_string(line, "unlimited", sizeof(line));
|
ast_copy_string(line, "unlimited", sizeof(line));
|
||||||
} else {
|
} else {
|
||||||
snprintf(line, sizeof(line), "%d/%d", (int) rl.rlim_cur, (int) rl.rlim_max);
|
snprintf(line, sizeof(line), "%d", (int) rl.rlim_cur);
|
||||||
}
|
}
|
||||||
ast_cli(a->fd, "Current maxfiles: %s\n", line);
|
ast_cli(a->fd, "Current maxfiles: %s\n", line);
|
||||||
for (i = 0; i < ARRAY_LEN(fdleaks); i++) {
|
for (i = 0; i < ARRAY_LEN(fdleaks); i++) {
|
||||||
|
Reference in New Issue
Block a user