From Volker L
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 22 Oct 2009 01:19:40 +0000 (12:19 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 22 Oct 2009 01:19:40 +0000 (12:19 +1100)
Fix some warnings  and an incorrect check for a talloc failure

server/ctdb_recoverd.c
server/ctdb_takeover.c
server/eventscript.c

index 08d7dc2e67047667f2940b119924b68e7458a4c8..432af0710eee320e159cc315f5085d396e3b8e55 100644 (file)
@@ -1791,7 +1791,9 @@ static void disable_ip_check_handler(struct ctdb_context *ctdb, uint64_t srvid,
        }
 
        if (data.dsize != sizeof(uint32_t)) {
-               DEBUG(DEBUG_ERR,(__location__ " Wrong size for data :%lu expexting %lu\n", data.dsize, sizeof(uint32_t)));
+               DEBUG(DEBUG_ERR,(__location__ " Wrong size for data :%lu "
+                                "expexting %lu\n", (long unsigned)data.dsize,
+                                (long unsigned)sizeof(uint32_t)));
                return;
        }
        if (data.dptr == NULL) {
@@ -1827,7 +1829,7 @@ static void ip_reallocate_handler(struct ctdb_context *ctdb, uint64_t srvid,
 
        if (rec->ip_reallocate_ctx == NULL) {
                rec->ip_reallocate_ctx = talloc_new(rec);
-               CTDB_NO_MEMORY_FATAL(ctdb, caller);
+               CTDB_NO_MEMORY_FATAL(ctdb, rec->ip_reallocate_ctx);
        }
 
        caller = talloc(rec->ip_reallocate_ctx, struct ip_reallocate_list);
@@ -1853,10 +1855,15 @@ static void process_ipreallocate_requests(struct ctdb_context *ctdb, struct ctdb
        result.dptr  = (uint8_t *)&ret;
 
        for (callers=rec->reallocate_callers; callers; callers=callers->next) {
-               DEBUG(DEBUG_INFO,("Sending ip reallocate reply message to %u:%lu\n", callers->rd->pnn, callers->rd->srvid));
+               DEBUG(DEBUG_INFO,("Sending ip reallocate reply message to "
+                                 "%u:%lu\n", (unsigned)callers->rd->pnn,
+                                 (long unsigned)callers->rd->srvid));
                ret = ctdb_send_message(ctdb, callers->rd->pnn, callers->rd->srvid, result);
                if (ret != 0) {
-                       DEBUG(DEBUG_ERR,("Failed to send ip reallocate reply message to %u:%lu\n", callers->rd->pnn, callers->rd->srvid));
+                       DEBUG(DEBUG_ERR,("Failed to send ip reallocate reply "
+                                        "message to %u:%lu\n",
+                                        (unsigned)callers->rd->pnn,
+                                        (long unsigned)callers->rd->srvid));
                }
        }
 
index 6eb2acfa755f0a8f6cc3b91d02da9acc403e8994..559f7fbf166f82daa4b31009735e250c0bd2e9e1 100644 (file)
@@ -1061,7 +1061,12 @@ int32_t ctdb_control_tcp_client(struct ctdb_context *ctdb, uint32_t client_id,
                tcp_sock = (struct ctdb_control_tcp_addr *)indata.dptr;
                break;
        default:
-               DEBUG(DEBUG_ERR,(__location__ " Invalid data structure passed to ctdb_control_tcp_client. size was %d but only allowed sizes are %lu and %lu\n", (int)indata.dsize, sizeof(struct ctdb_control_tcp), sizeof(struct ctdb_control_tcp_addr)));
+               DEBUG(DEBUG_ERR,(__location__ " Invalid data structure passed "
+                                "to ctdb_control_tcp_client. size was %d but "
+                                "only allowed sizes are %lu and %lu\n",
+                                (int)indata.dsize,
+                                (long unsigned)sizeof(struct ctdb_control_tcp),
+                                (long unsigned)sizeof(struct ctdb_control_tcp_addr)));
                return -1;
        }
 
index 8a62af9c5422c3451d71fc06d7e5fe4aabc55a11..aae5eef11d4987ee2a8ac9b111e229664198ee47 100644 (file)
@@ -969,7 +969,7 @@ int32_t ctdb_run_eventscripts(struct ctdb_context *ctdb,
        ret = ctdb_event_script_callback(ctdb, 
                         timeval_current_ofs(ctdb->tunable.script_timeout, 0),
                         state, run_eventscripts_callback, state,
-                        (const char *)indata.dptr);
+                        "%s", (const char *)indata.dptr);
 
        if (ret != 0) {
                ctdb_enable_monitoring(ctdb);