From 65860cfc558356c7cf17fd76af3f8de9b7442ef1 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Thu, 26 Jul 2012 08:33:29 +0200 Subject: [PATCH] valgrind prevent crash hack --- libs/wine/loader.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libs/wine/loader.c b/libs/wine/loader.c index df0a6b5b6d7..c59f26215d1 100644 --- a/libs/wine/loader.c +++ b/libs/wine/loader.c @@ -45,6 +45,10 @@ #include "winbase.h" #include "wine/library.h" +#ifdef HAVE_VALGRIND_MEMCHECK_H +#include +#endif + #ifdef __APPLE__ #include #define environ (*_NSGetEnviron()) @@ -639,7 +643,6 @@ int wine_dll_get_owner( const char *name, char *buffer, int size, int *exists ) return ret; } - /*********************************************************************** * set_max_limit * @@ -650,6 +653,11 @@ static void set_max_limit( int limit ) #ifdef HAVE_SETRLIMIT struct rlimit rlimit; +#if defined(RLIMIT_NOFILE) && defined(RUNNING_ON_VALGRIND) + if (limit == RLIMIT_NOFILE && RUNNING_ON_VALGRIND) + return; +#endif + if (!getrlimit( limit, &rlimit )) { rlimit.rlim_cur = rlimit.rlim_max; -- 2.11.4.GIT