edje_cc: check HAVE_SYS_RESOURCE_H presence for rlimit usage

fix T6645
This commit is contained in:
Mike Blumenkrantz 2018-01-27 11:55:40 -05:00
parent 97ec48434f
commit 18e392b502
1 changed files with 8 additions and 1 deletions

View File

@ -7,7 +7,10 @@
#include <limits.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/resource.h>
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
#endif
#include "edje_cc.h"
int _edje_cc_log_dom = -1;
@ -413,12 +416,16 @@ main(int argc, char **argv)
edje_file->efl_version.minor = 18;
edje_file->base_scale = FROM_INT(1);
#ifdef HAVE_SYS_RESOURCE_H
{
struct rlimit lim;
if (getrlimit(RLIMIT_NOFILE, &lim))
fprintf(stderr, "error getting max open file limit: %s\n", strerror(errno));
max_open_files = lim.rlim_cur;
}
#else
max_open_files = 1024;
#endif
ecore_evas_init();
source_edd();