Skip to content
Snippets Groups Projects
Commit d1006fab authored by Joshua Colp's avatar Joshua Colp Committed by Gerrit Code Review
Browse files

Merge "astfd: With RLIMIT_NOFILE only the current value is sensible."

parents 4eb8cf26 0bf1a53d
Branches
Tags
No related merge requests found
......@@ -276,10 +276,10 @@ static char *handle_show_fd(struct ast_cli_entry *e, int cmd, struct ast_cli_arg
return NULL;
}
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));
} 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);
for (i = 0; i < ARRAY_LEN(fdleaks); i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment