X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fio-layer%2Fshared.c;h=f8539039cad103441bc63f977c3331251ff5df2c;hb=3572dc9101024332ede058d1de5b3d71cd8e0329;hp=26e6bd81d19b339069fb7da8c97fca69d21f593e;hpb=375cbf369c94ef57fcd9a97f568d4e6415916ab4;p=mono.git diff --git a/mono/io-layer/shared.c b/mono/io-layer/shared.c index 26e6bd81d19..f8539039cad 100644 --- a/mono/io-layer/shared.c +++ b/mono/io-layer/shared.c @@ -44,8 +44,6 @@ static mono_mutex_t noshm_sems[_WAPI_SHARED_SEM_COUNT]; -gboolean _wapi_shm_disabled = TRUE; - static gpointer wapi_storage [16]; static void @@ -152,12 +150,13 @@ _wapi_shm_detach (_wapi_shm_t type) } gboolean -_wapi_shm_enabled (void) +_wapi_shm_enabled_internal (void) { return FALSE; } -#else +#else /* DISABLE_SHARED_HANDLES */ + /* * Use POSIX shared memory if possible, it is simpler, and it has the advantage that * writes to the shared area does not need to be written to disk, avoiding spinning up @@ -167,6 +166,8 @@ _wapi_shm_enabled (void) #define USE_SHM 1 #endif +static gboolean _wapi_shm_disabled = TRUE; + static gchar * _wapi_shm_base_name (_wapi_shm_t type) { @@ -254,7 +255,8 @@ static gchar * _wapi_shm_file (_wapi_shm_t type) { static gchar file[_POSIX_PATH_MAX]; - gchar *name = NULL, *filename, *wapi_dir; + gchar *name = NULL, *filename; + const gchar *wapi_dir; name = _wapi_shm_base_name (type); @@ -262,7 +264,7 @@ _wapi_shm_file (_wapi_shm_t type) * nfs mounts breaks, then there should be an option to set * the directory. */ - wapi_dir = getenv ("MONO_SHARED_DIR"); + wapi_dir = g_getenv ("MONO_SHARED_DIR"); if (wapi_dir == NULL) { filename = g_build_filename (g_get_home_dir (), ".wapi", name, NULL); @@ -403,7 +405,7 @@ try_again: } gboolean -_wapi_shm_enabled (void) +_wapi_shm_enabled_internal (void) { static gboolean env_checked;