1
1

Fixes trac:2812: check for env. markers indicating that we're in a

fakeroot.  If so, exit out of the pre-main hook immediately (without
calling functions such as stat, which will be replaced by fakeroot to
things that are not safe to call in a pre-main environment).

This commit was SVN r26203.

The following Trac tickets were found above:
  Ticket 2812 --> https://svn.open-mpi.org/trac/ompi/ticket/2812
Этот коммит содержится в:
Jeff Squyres 2012-03-28 16:41:29 +00:00
родитель d62c0f1872
Коммит 8a2df3311d

Просмотреть файл

@ -738,7 +738,17 @@ static void opal_memory_linux_malloc_init_hook(void)
check_result_t r1, r2, lp, lpp; check_result_t r1, r2, lp, lpp;
bool want_rcache = false, found_driver = false; bool want_rcache = false, found_driver = false;
/* First, check if ummunotify is present on the system. If it is, /* First, check for a FAKEROOT environment. If we're in a
fakeroot, then stat() (and likely others) have been replaced
and are not safe to call here in this pre-main environment. So
check for the environment markers that we're in a FAKEROOT.
And if so, return immediately. */
if (getenv("FAKEROOTKEY") != NULL ||
getenv("FAKE_ROOT_MODE") != NULL) {
return;
}
/* Next, check if ummunotify is present on the system. If it is,
then we don't need to do the following ptmalloc2 hacks. then we don't need to do the following ptmalloc2 hacks.
open/mmap on the device may fail during init, but if /dev/ummunotify open/mmap on the device may fail during init, but if /dev/ummunotify
exists, we assume that the user/administrator *wants* to use exists, we assume that the user/administrator *wants* to use