[Asterisk-code-review] astfd: With RLIMIT NOFILE only the current value is sensible. (asterisk[master])

Alexander Traud asteriskteam at digium.com
Wed Jun 8 06:10:40 CDT 2016


Alexander Traud has uploaded a new change for review.

  https://gerrit.asterisk.org/2968

Change subject: astfd: With RLIMIT_NOFILE only the current value is sensible.
......................................................................

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
---
M main/astfd.c
1 file changed, 1 insertion(+), 6 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/68/2968/1

diff --git a/main/astfd.c b/main/astfd.c
index d1879f0..5305a09 100644
--- a/main/astfd.c
+++ b/main/astfd.c
@@ -276,12 +276,7 @@
 		return NULL;
 	}
 	getrlimit(RLIMIT_NOFILE, &rl);
-	if (rl.rlim_cur == RLIM_INFINITY || rl.rlim_max == RLIM_INFINITY) {
-		ast_copy_string(line, "unlimited", sizeof(line));
-	} else {
-		snprintf(line, sizeof(line), "%d/%d", (int) rl.rlim_cur, (int) rl.rlim_max);
-	}
-	ast_cli(a->fd, "Current maxfiles: %s\n", line);
+	ast_cli(a->fd, "Current maxfiles: %d\n", (int) rl.rlim_cur);
 	for (i = 0; i < ARRAY_LEN(fdleaks); i++) {
 		if (fdleaks[i].isopen) {
 			struct ast_tm tm = {0};

-- 
To view, visit https://gerrit.asterisk.org/2968
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I49cf7952d73aec9e3f6a88942842c39be18380fa
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Alexander Traud <pabstraud at compuserve.com>



More information about the asterisk-code-review mailing list