pike.git / src / main.c

version» Context lines:

pike.git/src/main.c:1:   /*\   ||| This file a part of uLPC, and is copyright by Fredrik Hubinette   ||| uLPC is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/ - #include <stdio.h> - #include <stdlib.h> +    #include "global.h"   #include "types.h" -  - #ifdef HAVE_SYS_TIME_H - #include <sys/time.h> - #endif -  +    #include "backend.h"   #include "module.h"   #include "object.h"   #include "lex.h"   #include "lpc_types.h"   #include "builtin_efuns.h"   #include "array.h"   #include "stralloc.h"   #include "interpret.h"   #include "error.h"   #include "macros.h"   #include "callback.h"   #include "lpc_signal.h"      #ifdef HAVE_LOCALE_H   #include <locale.h>   #endif -  + #ifdef HAVE_SYS_TIME_H + #include <sys/time.h> + #endif   #ifdef HAVE_SYS_RESOURCE_H   #include <sys/resource.h>   #endif      char *master_file;      int d_flag=0;   int c_flag=0;   int t_flag=0;   int a_flag=0;
pike.git/src/main.c:130:    }    }    }else{    break;    }    }      #if !defined(RLIMIT_NOFILE) && defined(RLIMIT_OFILE)   #define RLIMIT_NOFILE RLIMIT_OFILE   #endif - #ifndef RLIM_INFINITY - #define RLIM_INFINITY 0x7fffffff - #endif +       #if defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE)    {    struct rlimit lim;    long tmp;    if(!getrlimit(RLIMIT_NOFILE, &lim))    { -  if(lim.rlim_max == RLIM_INFINITY) tmp=0x7fffffff; + #ifdef RLIM_INFINITY +  if(lim.rlim_max == RLIM_INFINITY) +  lim.rlim_max=MAX_OPEN_FILEDESCRIPTORS; + #endif    tmp=MINIMUM(lim.rlim_max, MAX_OPEN_FILEDESCRIPTORS);    lim.rlim_cur=tmp;    setrlimit(RLIMIT_NOFILE, &lim);    }    }   #endif       current_time = get_current_time();       init_modules_efuns();