Rev 27: merge from ab in http://samba.org/~tridge/ctdb/
tridge at samba.org
tridge at samba.org
Fri Dec 1 10:16:32 GMT 2006
------------------------------------------------------------
revno: 27
revision-id: tridge at samba.org-20061201101632-cxm55gpfbco9m7mi
parent: tridge at samba.org-20061201045415-m377f8xq177vlehi
parent: ab at samba.org-20061201092621-9a26da6a0da17522
committer: Andrew Tridgell <tridge at samba.org>
branch nick: ctdb
timestamp: Fri 2006-12-01 21:16:32 +1100
message:
merge from ab
modified:
common/ctdb_call.c ctdb_call.c-20061128065342-to93h6eejj5kon81-1
include/ctdb_private.h ctdb_private.h-20061117234101-o3qt14umlg9en8z0-13
------------------------------------------------------------
revno: 12.1.10
merged: ab at samba.org-20061201092621-9a26da6a0da17522
parent: ab at samba.org-20061201091018-af1ad52b48cbd8d9
committer: Alexander Bokovoy <ab at samba.org>
branch nick: ctdb
timestamp: Fri 2006-12-01 12:26:21 +0300
message:
Provide an alternative CTDB_NO_MEMORY_NULL() for functions which return a pointer
------------------------------------------------------------
revno: 12.1.9
merged: ab at samba.org-20061201091018-af1ad52b48cbd8d9
parent: ab at samba.org-20061129144852-402d776d0fb10c72
parent: tridge at samba.org-20061201045415-m377f8xq177vlehi
committer: Alexander Bokovoy <ab at samba.org>
branch nick: ctdb
timestamp: Fri 2006-12-01 12:10:18 +0300
message:
Merge from tridge
=== modified file 'common/ctdb_call.c'
--- a/common/ctdb_call.c 2006-12-01 04:45:24 +0000
+++ b/common/ctdb_call.c 2006-12-01 09:26:21 +0000
@@ -186,7 +186,7 @@
int ret;
state = talloc_zero(ctdb, struct ctdb_call_state);
- CTDB_NO_MEMORY(ctdb, state);
+ CTDB_NO_MEMORY_NULL(ctdb, state);
state->state = CTDB_CALL_DONE;
state->node = ctdb->nodes[ctdb->vnn];
@@ -213,11 +213,11 @@
}
state = talloc_zero(ctdb, struct ctdb_call_state);
- CTDB_NO_MEMORY(ctdb, state);
+ CTDB_NO_MEMORY_NULL(ctdb, state);
len = sizeof(*state->c) + key.dsize + (call_data?call_data->dsize:0);
state->c = talloc_size(ctdb, len);
- CTDB_NO_MEMORY(ctdb, state->c);
+ CTDB_NO_MEMORY_NULL(ctdb, state->c);
state->c->hdr.length = len;
state->c->hdr.operation = CTDB_REQ_CALL;
=== modified file 'include/ctdb_private.h'
--- a/include/ctdb_private.h 2006-12-01 04:45:24 +0000
+++ b/include/ctdb_private.h 2006-12-01 09:26:21 +0000
@@ -94,6 +94,10 @@
ctdb_set_error(ctdb, "Out of memory at %s:%d", __FILE__, __LINE__); \
return -1; }} while (0)
+#define CTDB_NO_MEMORY_NULL(ctdb, p) do { if (!(p)) { \
+ ctdb_set_error(ctdb, "Out of memory at %s:%d", __FILE__, __LINE__); \
+ return NULL; }} while (0)
+
/* arbitrary maximum timeout for ctdb operations */
#define CTDB_REQ_TIMEOUT 10
More information about the samba-cvs
mailing list