summaryrefslogtreecommitdiffstats
path: root/ctdb/common
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2012-06-06 16:16:15 +1000
committerAmitay Isaacs <amitay@gmail.com>2012-07-16 12:12:05 +1000
commit51c57e87e5b1dcc64c244c2f40ee80871333a128 (patch)
tree26e1ebde9a4bd371f870bf0650c2bbf8eb90c98b /ctdb/common
parente379fc3ea58c95bc1c1e2dd18758cb00f59d8e12 (diff)
downloadsamba-51c57e87e5b1dcc64c244c2f40ee80871333a128.tar.gz
samba-51c57e87e5b1dcc64c244c2f40ee80871333a128.tar.xz
samba-51c57e87e5b1dcc64c244c2f40ee80871333a128.zip
util: Do not try to lockdown memory when running in local daemons mode
Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 25f84797a64a683c303b04057aa8113e9fc47c49)
Diffstat (limited to 'ctdb/common')
-rw-r--r--ctdb/common/ctdb_util.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ctdb/common/ctdb_util.c b/ctdb/common/ctdb_util.c
index b9af95bfb1b..30effdd52ef 100644
--- a/ctdb/common/ctdb_util.c
+++ b/ctdb/common/ctdb_util.c
@@ -642,10 +642,15 @@ void ctdb_lockdown_memory(struct ctdb_context *ctdb)
return;
}
+ /* Ignore when running in local daemons mode */
+ if (getpid() != 0) {
+ return;
+ }
+
/* Avoid compiler optimizing out dummy. */
mlock(dummy, sizeof(dummy));
if (mlockall(MCL_CURRENT) != 0) {
- DEBUG(DEBUG_WARNING,("Failed to lock memory: %s'\n",
+ DEBUG(DEBUG_WARNING,("Failed to lockdown memory: %s'\n",
strerror(errno)));
}
#endif