diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2010-03-25 11:21:10 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2010-03-25 11:21:10 +0100 |
commit | 7e1060295a63242bc22394b6873de6e6db2b4765 (patch) | |
tree | 221bae37f1e888fdb2ef9b4623a37c9b2766f4fc /tests | |
parent | bdb632e6d2ed6fe86f2f6d3163932e33fc2959a9 (diff) | |
download | rsyslog-7e1060295a63242bc22394b6873de6e6db2b4765.tar.gz rsyslog-7e1060295a63242bc22394b6873de6e6db2b4765.tar.xz rsyslog-7e1060295a63242bc22394b6873de6e6db2b4765.zip |
manytcp test tool must tell OS to provide enough file handles
On some platforms, the default is too low to carry out all test cases
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tcpflood.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/tcpflood.c b/tests/tcpflood.c index 32bf959d..259b84b3 100644 --- a/tests/tcpflood.c +++ b/tests/tcpflood.c @@ -370,6 +370,20 @@ int main(int argc, char *argv[]) } } + if(numConnections > 20) { + /* if we use many (whatever this means, 20 is randomly picked) + * connections, we need to make sure we have a high enough + * limit. -- rgerhards, 2010-03-25 + */ + struct rlimit maxFiles; + maxFiles.rlim_cur = numConnections + 20; + maxFiles.rlim_max = numConnections + 20; + if(setrlimit(RLIMIT_NOFILE, &maxFiles) < 0) { + perror("setrlimit to increase file handles failed"); + exit(1); + } + } + if(openConnections() != 0) { printf("error opening connections\n"); exit(1); |