Ticket #22297: patch-honeyd.c.diff

File patch-honeyd.c.diff, 571 bytes (added by darenzana@…, 15 years ago)

source code patch

  • honeyd.c

    old new  
    3232
    3333#include <sys/param.h>
    3434#include <sys/types.h>
     35#include <sys/syslimits.h>
    3536
    3637#ifdef HAVE_CONFIG_H
    3738#include "config.h"
     
    450451
    451452        /* Raising file descriptor limits */
    452453        rl.rlim_max = RLIM_INFINITY;
    453         rl.rlim_cur = RLIM_INFINITY;
     454        rl.rlim_cur = ( OPEN_MAX < RLIM_INFINITY) ? OPEN_MAX : RLIM_INFINITY ;
    454455        if (setrlimit(RLIMIT_NOFILE, &rl) == -1) {
    455456                /* Linux does not seem to like this */
    456457                if (getrlimit(RLIMIT_NOFILE, &rl) == -1)