Skip to content

Commit

Permalink
Merge pull request #1 from NikolausDemmel/lunar-devel
Browse files Browse the repository at this point in the history
XmlRpcServer: use unsigned int for rlimit
  • Loading branch information
trainman419 authored Apr 2, 2018
2 parents 1aba89a + 7279a8a commit 95f6a97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utilities/xmlrpcpp/src/XmlRpcServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ XmlRpcServer::XmlRpcServer()
_accept_retry_time_sec(0.0)
{
struct rlimit limit = { .rlim_cur = 0, .rlim_max = 0 };
int max_files = 1024;
unsigned int max_files = 1024;

if(getrlimit(RLIMIT_NOFILE, &limit) == 0) {
max_files = limit.rlim_max;
if( max_files == RLIM_INFINITY ) {
if( limit.rlim_max == RLIM_INFINITY ) {
max_files = 0;
}
} else {
XmlRpcUtil::error("Could not get open file limit: %s", strerror(errno));
}
pollfds.resize(max_files);
for(int i=0; i<max_files; i++) {
for(unsigned int i=0; i<max_files; i++) {
// Set up file descriptor query for all events.
pollfds[i].fd = i;
pollfds[i].events = POLLIN | POLLPRI | POLLOUT;
Expand Down

0 comments on commit 95f6a97

Please sign in to comment.