server: Replace BOOL datatype with bool, True/False with true/false
authorAmitay Isaacs <amitay@gmail.com>
Thu, 17 May 2012 06:08:37 +0000 (16:08 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Mon, 28 May 2012 01:22:25 +0000 (11:22 +1000)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 6e5cbe8fff71985e5a2fc16b7e9f2b868011ff5d)

ctdb/client/ctdb_client.c
ctdb/common/rb_tree.c
ctdb/include/includes.h
ctdb/lib/util/util.c
ctdb/server/ctdb_call.c
ctdb/server/ctdb_control.c
ctdb/server/ctdb_daemon.c
ctdb/server/ctdb_freeze.c
ctdb/server/ctdb_takeover.c
ctdb/server/ctdbd.c

index 69b0a04888c2df7ea05485bc6b155fbc808ac8da..9162a476fa5f37d8067e239ecce31221620005dd 100644 (file)
@@ -2023,7 +2023,7 @@ static void traverse_handler(struct ctdb_context *ctdb, uint64_t srvid, TDB_DATA
        if (data.dsize < sizeof(uint32_t) ||
            d->length != data.dsize) {
                DEBUG(DEBUG_ERR,("Bad data size %u in traverse_handler\n", (unsigned)data.dsize));
-               state->done = True;
+               state->done = true;
                return;
        }
 
@@ -2034,7 +2034,7 @@ static void traverse_handler(struct ctdb_context *ctdb, uint64_t srvid, TDB_DATA
 
        if (key.dsize == 0 && data.dsize == 0) {
                /* end of traverse */
-               state->done = True;
+               state->done = true;
                return;
        }
 
@@ -2046,7 +2046,7 @@ static void traverse_handler(struct ctdb_context *ctdb, uint64_t srvid, TDB_DATA
        }
 
        if (state->fn(ctdb, key, data, state->private_data) != 0) {
-               state->done = True;
+               state->done = true;
        }
 
        state->count++;
@@ -2071,7 +2071,7 @@ static int ctdb_traverse_ext(struct ctdb_db_context *ctdb_db,
        uint64_t srvid = (getpid() | 0xFLL<<60);
        struct traverse_state state;
 
-       state.done = False;
+       state.done = false;
        state.count = 0;
        state.private_data = private_data;
        state.fn = fn;
index bff7c5a4c4f35cb7fa3c5cf8f58404bede097dd8..6b131bc0932b66afd622bf5c70a476d8deac4faf 100644 (file)
@@ -447,7 +447,7 @@ trbt_delete_case1(trbt_node_t *node)
 }
 
 static void
-delete_node(trbt_node_t *node, BOOL from_destructor)
+delete_node(trbt_node_t *node, bool from_destructor)
 {
        trbt_node_t *parent, *child, dc;
        trbt_node_t *temp = NULL;
@@ -606,7 +606,7 @@ finished:
  */
 static int node_destructor(trbt_node_t *node)
 {
-       delete_node(node, True);
+       delete_node(node, true);
 
        return 0;
 }
@@ -746,7 +746,7 @@ trbt_delete32(trbt_tree_t *tree, uint32_t key)
 
        while(node){
                if(key==node->key32){
-                       delete_node(node, False);
+                       delete_node(node, false);
                        return;
                }
                if(key<node->key32){
index b5655335af585920c6b87d0db5e3c61fc5ab2019..e0ce06b82a40ae1006e4fa6eae791799e68c43eb 100644 (file)
 
 #include "tevent.h"
 
-typedef bool BOOL;
-
-#define True 1
-#define False 0
-
 extern int LogLevel;
 extern int this_log_level;
 
@@ -64,7 +59,7 @@ double timeval_delta(struct timeval *tv2, struct timeval *tv);
 char **file_lines_load(const char *fname, int *numlines, TALLOC_CTX *mem_ctx);
 char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, size_t len);
 _PUBLIC_ const char **str_list_add(const char **list, const char *s);
-_PUBLIC_ int set_blocking(int fd, BOOL set);
+_PUBLIC_ int set_blocking(int fd, bool set);
 
 #include "lib/util/debug.h"
 #include "lib/util/util.h"
index e19b2dc1fe9557d3401e1f965f005b98c7999986..af5280599547e199272e22746d43ac3844d0f39b 100644 (file)
@@ -28,7 +28,7 @@
   if BSD use FNDELAY
 **/
 
-_PUBLIC_ int set_blocking(int fd, BOOL set)
+_PUBLIC_ int set_blocking(int fd, bool set)
 {
        int val;
 #ifdef O_NONBLOCK
index fe7e947c036813716ef17d76a32c02745d87c446..b7a4fe3915d84cf6195468340c3ba755ad11da3e 100644 (file)
@@ -462,7 +462,7 @@ void ctdb_request_dmaster(struct ctdb_context *ctdb, struct ctdb_req_header *hdr
        
        /* fetch the current record */
        ret = ctdb_ltdb_lock_fetch_requeue(ctdb_db, key, &header, hdr, &data2,
-                                          ctdb_call_input_pkt, ctdb, False);
+                                          ctdb_call_input_pkt, ctdb, false);
        if (ret == -1) {
                ctdb_fatal(ctdb, "ctdb_req_dmaster failed to fetch record");
                return;
@@ -723,7 +723,7 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
           if the call will be answered locally */
 
        ret = ctdb_ltdb_lock_fetch_requeue(ctdb_db, call->key, &header, hdr, &data,
-                                          ctdb_call_input_pkt, ctdb, False);
+                                          ctdb_call_input_pkt, ctdb, false);
        if (ret == -1) {
                ctdb_send_error(ctdb, hdr, ret, "ltdb fetch failed in ctdb_request_call");
                return;
@@ -977,7 +977,7 @@ void ctdb_reply_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
                key.dsize = state->c->keylen;
                key.dptr  = state->c->data;
                ret = ctdb_ltdb_lock_requeue(ctdb_db, key, hdr,
-                                    ctdb_call_input_pkt, ctdb, False);
+                                    ctdb_call_input_pkt, ctdb, false);
                if (ret == -2) {
                        return;
                }
@@ -1063,7 +1063,7 @@ void ctdb_reply_dmaster(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
        }
 
        ret = ctdb_ltdb_lock_requeue(ctdb_db, key, hdr,
-                                    ctdb_call_input_pkt, ctdb, False);
+                                    ctdb_call_input_pkt, ctdb, false);
        if (ret == -2) {
                return;
        }
index 2a16a23ad80ed693c71a799bdbf17f6004385f66..5c1eedd4c98d9abe4153d9c4956a589c63802ae8 100644 (file)
@@ -703,7 +703,7 @@ void ctdb_request_control(struct ctdb_context *ctdb, struct ctdb_req_header *hdr
        struct ctdb_req_control *c = (struct ctdb_req_control *)hdr;
        TDB_DATA data, *outdata;
        int32_t status;
-       bool async_reply = False;
+       bool async_reply = false;
        const char *errormsg = NULL;
 
        data.dptr = &c->data[0];
index 899b3bd8fa8eac731e0097044560618612314ef3..a61e7d369d441e27a24a40d5b3b440c3f46ae9ba 100644 (file)
@@ -657,7 +657,7 @@ static void daemon_request_call_from_client(struct ctdb_client *client,
 
        ret = ctdb_ltdb_lock_fetch_requeue(ctdb_db, key, &header, 
                                           (struct ctdb_req_header *)c, &data,
-                                          daemon_incoming_packet_wrap, w, True);
+                                          daemon_incoming_packet_wrap, w, true);
        if (ret == -2) {
                /* will retry later */
                CTDB_DECREMENT_STAT(ctdb, pending_calls);
@@ -1068,7 +1068,7 @@ int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork, bool use_syslog,
                return 0;
        }
 
-       tdb_reopen_all(False);
+       tdb_reopen_all(false);
 
        if (do_fork) {
                setsid();
index 56dc19c2c2d405a8bfef5c2918d627fbcf62df0a..c8941f20a79c87dd78aea6b436d9b4f31d756528 100644 (file)
@@ -335,7 +335,7 @@ int32_t ctdb_control_freeze(struct ctdb_context *ctdb, struct ctdb_req_control *
        DLIST_ADD(ctdb->freeze_handles[priority]->waiters, w);
 
        /* we won't reply till later */
-       *async_reply = True;
+       *async_reply = true;
        return 0;
 }
 
index ee6c7239542c80728e242556e342f8332075fcd4..0ba12b131668bffa1861cbba968fba10925af6fb 100644 (file)
@@ -3874,6 +3874,6 @@ int32_t ctdb_control_reload_public_ips(struct ctdb_context *ctdb, struct ctdb_re
                        ctdb_reloadips_timeout_event, h);
 
        /* we reply later */
-       *async_reply = True;
+       *async_reply = true;
        return 0;
 }
index 8eee5f2784c9656a81cc8bb702816637ccf68e5e..ddda8ffbe21c0071608f0cbc7fdeb21c12ee24c8 100644 (file)
@@ -346,5 +346,5 @@ int main(int argc, const char *argv[])
        }
 
        /* start the protocol running (as a child) */
-       return ctdb_start_daemon(ctdb, interactive?False:True, options.use_syslog, options.public_address_list);
+       return ctdb_start_daemon(ctdb, interactive?false:true, options.use_syslog, options.public_address_list);
 }