]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
merge from ronnie
authorAndrew Tridgell <tridge@samba.org>
Thu, 10 May 2007 03:15:58 +0000 (13:15 +1000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 10 May 2007 03:15:58 +0000 (13:15 +1000)
(This used to be ctdb commit 92b7a849565730744c75a7fb776173554e9f57bf)

1  2 
ctdb/direct/ctdb_recoverd.c
ctdb/include/ctdb_private.h
ctdb/tools/ctdb_control.c

Simple merge
index 0b627458106a201e41e7fc7a37cb29d5d39da85d,0b627458106a201e41e7fc7a37cb29d5d39da85d..e72f6150de96e2eccedeaabd5589c9d6d76d76fa
@@@ -260,18 -260,18 +260,22 @@@ struct ctdb_db_context 
  
  
  #define CTDB_NO_MEMORY(ctdb, p) do { if (!(p)) { \
++          DEBUG(0,("Out of memory for %s at %s\n", #p, __location__)); \
            ctdb_set_error(ctdb, "Out of memory at %s:%d", __FILE__, __LINE__); \
          return -1; }} while (0)
  
  #define CTDB_NO_MEMORY_VOID(ctdb, p) do { if (!(p)) { \
++          DEBUG(0,("Out of memory for %s at %s\n", #p, __location__)); \
            ctdb_set_error(ctdb, "Out of memory at %s:%d", __FILE__, __LINE__); \
          }} while (0)
  
  #define CTDB_NO_MEMORY_NULL(ctdb, p) do { if (!(p)) { \
++          DEBUG(0,("Out of memory for %s at %s\n", #p, __location__)); \
            ctdb_set_error(ctdb, "Out of memory at %s:%d", __FILE__, __LINE__); \
          return NULL; }} while (0)
  
  #define CTDB_NO_MEMORY_FATAL(ctdb, p) do { if (!(p)) { \
++          DEBUG(0,("Out of memory for %s at %s\n", #p, __location__)); \
            ctdb_fatal(ctdb, "Out of memory in " __location__ ); \
          }} while (0)
  
index 2dd062f4208245ec89c308f53dd3984948fbcb15,9a893e98f38e4846083047c6caf958d89f397753..ea57257316c7abd4a0978965ec1994bf4392abaa
@@@ -604,13 -799,19 +604,14 @@@ static int control_setvnnmap(struct ctd
        generation = strtoul(argv[1], NULL, 0);
        num_nodes  = strtoul(argv[2], NULL, 0);
  
-       vnnmap = talloc_zero_size(ctdb, offsetof(struct ctdb_vnn_map, map) + 4*num_nodes);
-       if (vnnmap == NULL) {
-               DEBUG(0,(__location__ " Unable to allocate vnn_map structure\n"));
-               exit(1);
-       }
+       vnnmap = talloc(ctdb, struct ctdb_vnn_map);
 -      if (vnnmap == NULL) {
 -              DEBUG(0,(__location__ " Unable to allocate vnn_map structure\n"));
 -              exit(1);
 -      }
++      CTDB_NO_MEMORY(ctdb, vnnmap);
++
        vnnmap->generation = generation;
        vnnmap->size       = num_nodes;
 -      if (vnnmap->map == NULL) {
 -              DEBUG(0,(__location__ " Unable to allocate vnn_map->map array\n"));
 -              exit(1);
 -      }
+       vnnmap->map        = talloc_array(vnnmap, uint32_t, vnnmap->size);
++      CTDB_NO_MEMORY(ctdb, vnnmap->map);
        for (i=0;i<vnnmap->size;i++) {
                vnnmap->map[i] = strtoul(argv[3+i], NULL, 0);
        }