fix more warnings

This commit is contained in:
arvidn
2015-08-18 16:42:03 +02:00
parent 12da02ae52
commit 26fecaf037
8 changed files with 106 additions and 72 deletions

View File

@@ -39,6 +39,10 @@ POSSIBILITY OF SUCH DAMAGE.
#if TORRENT_USE_RLIMIT
#include <sys/resource.h>
// capture this here where warnings are disabled (the macro generates warnings)
const rlim_t rlimit_as = RLIMIT_AS;
const rlim_t rlim_infinity = RLIM_INFINITY;
#endif
#ifdef TORRENT_BSD
@@ -93,7 +97,7 @@ namespace libtorrent
if (ret > 0)
{
struct rlimit r;
if (getrlimit(RLIMIT_AS, &r) == 0 && r.rlim_cur != RLIM_INFINITY)
if (getrlimit(rlimit_as, &r) == 0 && r.rlim_cur != rlim_infinity)
{
if (ret > r.rlim_cur)
ret = r.rlim_cur;