Skip to content

Commit b51c4e2

Browse files
committed
memory/patcher: fix a compiler warning
Don't define the madvise intercept functions since we're not currently intercepting madvise. Signed-off-by: Jeff Squyres <[email protected]>
1 parent 60ca372 commit b51c4e2

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

opal/mca/memory/patcher/memory_patcher_component.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* University of Stuttgart. All rights reserved.
1111
* Copyright (c) 2004-2005 The Regents of the University of California.
1212
* All rights reserved.
13-
* Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved.
13+
* Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
1414
* Copyright (c) 2013-2017 Los Alamos National Security, LLC. All rights
1515
* reserved.
1616
* Copyright (c) 2016 Research Organization for Information Science
@@ -59,6 +59,11 @@ static int patcher_query (int *);
5959

6060
static int mca_memory_patcher_priority;
6161

62+
/* NTH: we can't currently allow madvise to be intercepted due to a
63+
* deadlock when running with glibc. In the future, we may re-enable
64+
* this hook if the deadlock can be resolved. */
65+
#define WANT_INTERCEPT_MADVISE 0
66+
6267
opal_memory_patcher_component_t mca_memory_patcher_component = {
6368
.super = {
6469
.memoryc_version = {
@@ -244,6 +249,7 @@ static void *intercept_mremap (void *start, size_t oldlen, void *new_address, si
244249

245250
#endif
246251

252+
#if WANT_INTERCEPT_MADVISE
247253
#if defined (SYS_madvise)
248254

249255
static int (*original_madvise) (void *, size_t, int);
@@ -278,6 +284,7 @@ static int intercept_madvise (void *start, size_t length, int advice)
278284
}
279285

280286
#endif
287+
#endif // WANT_INTERCEPT_MADVISE
281288

282289
#if defined SYS_brk
283290

@@ -496,16 +503,14 @@ static int patcher_open (void)
496503
}
497504
#endif
498505

499-
/* NTH: we can't currently allow madvise to be intercepted due to a deadlock when running with glibc. in
500-
* the future we may re-enable this hook if the deadlock can be resolved. */
501-
#if 0
506+
#if WANT_INTERCEPT_MADVISE
502507
#if defined (SYS_madvise)
503508
rc = opal_patcher->patch_symbol ("madvise", (uintptr_t)intercept_madvise, (uintptr_t *) &original_madvise);
504509
if (OPAL_SUCCESS != rc) {
505510
return rc;
506511
}
507512
#endif
508-
#endif
513+
#endif // WANT_INTERCEPT_MADVISE
509514

510515
#if defined(SYS_shmdt) && defined(__linux__)
511516
rc = opal_patcher->patch_symbol ("shmdt", (uintptr_t) intercept_shmdt, (uintptr_t *) &original_shmdt);

0 commit comments

Comments
 (0)