From: Alexander Traud Date: Wed, 8 Jun 2016 11:05:22 +0000 (+0200) Subject: astfd: With RLIMIT_NOFILE only the current value is sensible. X-Git-Tag: 14.0.0-beta1~104^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0bf1a53db381da91741acf545e9c6aa98421660d;p=thirdparty%2Fasterisk.git astfd: With RLIMIT_NOFILE only the current value is sensible. With menuselect "DEBUG_FD_LEAKS" and CLI "core show fd", both the maximum max and current max of possible file descriptors were shown. Both show the same value always. Not to confuse users, just the current maximum is shown now. ASTERISK-26097 Change-Id: I49cf7952d73aec9e3f6a88942842c39be18380fa --- diff --git a/main/astfd.c b/main/astfd.c index d1879f092c..0a5e7ec801 100644 --- a/main/astfd.c +++ b/main/astfd.c @@ -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++) {