summaryrefslogtreecommitdiffstats
path: root/ctdb/server/ctdb_control.c
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2011-11-16 15:25:14 +1100
committerMartin Schwenke <martin@meltin.net>2011-11-16 15:46:44 +1100
commitef20fead9521a0fb41fcdb93c4509bc345d1e998 (patch)
treeedd2f3dd568ca8b8f8796b303c086628c360224b /ctdb/server/ctdb_control.c
parent44de394796b8b4f1b046ccf226372cd8ba9ad768 (diff)
downloadsamba-ef20fead9521a0fb41fcdb93c4509bc345d1e998.tar.gz
samba-ef20fead9521a0fb41fcdb93c4509bc345d1e998.tar.xz
samba-ef20fead9521a0fb41fcdb93c4509bc345d1e998.zip
Relax an out of memory message.
The call to ctdb_transport_allocate() can fail for 2 reasons: * Unable to allocate memory. * The transport is down, perhaps because CTDB is shutting down. Either cause will be appropriately logged. The current use of CTDB_NO_MEMORY_VOID() prints an "out of memory" message regardless of what happened in ctdb_transport_allocate() and this could be misleading. Change this to print a more relaxed message. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 8c4a93e77c7d7d0cec6b2afd42c22475f1b5ccdc)
Diffstat (limited to 'ctdb/server/ctdb_control.c')
-rw-r--r--ctdb/server/ctdb_control.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ctdb/server/ctdb_control.c b/ctdb/server/ctdb_control.c
index 9c2f7429dd..667083cf73 100644
--- a/ctdb/server/ctdb_control.c
+++ b/ctdb/server/ctdb_control.c
@@ -648,7 +648,10 @@ void ctdb_request_control_reply(struct ctdb_context *ctdb, struct ctdb_req_contr
len += strlen(errormsg);
}
r = ctdb_transport_allocate(ctdb, ctdb, CTDB_REPLY_CONTROL, len, struct ctdb_reply_control);
- CTDB_NO_MEMORY_VOID(ctdb, r);
+ if (r == NULL) {
+ DEBUG(DEBUG_ERR,(__location__ "Unable to allocate transport - OOM or transport is down\n"));
+ return;
+ }
r->hdr.destnode = c->hdr.srcnode;
r->hdr.reqid = c->hdr.reqid;