diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2024-02-07 10:38:02 -0500 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2024-02-07 10:38:02 -0500 | 
| commit | 729dd6f6261933d51a49d68995ff70b6d015e4b5 (patch) | |
| tree | 11c757299759d0fa47b3a5e5efb0d24ebd382bbc /lib/event.c | |
| parent | 7fe05d6185d6c5846ef56eb767aef77b5629dff5 (diff) | |
lib, ospfclient, tests, vtysh: Allow for a minimum fd poll size
There exists cases where just honoring the FD_LIMIT size
as given to us by the operating system makes no sense.
Let's just make a switch to allow for this for things
like vtysh and ospfclient which will never have 1k files
open at any given time.
Fixes: #15315
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib/event.c')
| -rw-r--r-- | lib/event.c | 9 | 
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/event.c b/lib/event.c index 6427705e90..fc46a11c0b 100644 --- a/lib/event.c +++ b/lib/event.c @@ -570,9 +570,12 @@ struct event_loop *event_master_create(const char *name)  		rv->fd_limit = (int)limit.rlim_cur;  	} -	if (rv->fd_limit > STUPIDLY_LARGE_FD_SIZE) -		zlog_warn("FD Limit set: %u is stupidly large.  Is this what you intended?  Consider using --limit-fds", -			  rv->fd_limit); +	if (rv->fd_limit > STUPIDLY_LARGE_FD_SIZE) { +		zlog_warn("FD Limit set: %u is stupidly large.  Is this what you intended?  Consider using --limit-fds also limiting size to %u", +			  rv->fd_limit, STUPIDLY_LARGE_FD_SIZE); + +		rv->fd_limit = STUPIDLY_LARGE_FD_SIZE; +	}  	rv->read = XCALLOC(MTYPE_EVENT_POLL,  			   sizeof(struct event *) * rv->fd_limit);  | 
