From 064ffb17a18fb01a9afc6ef70d21dc875161c3c0 Mon Sep 17 00:00:00 2001 From: Fabien Thomas Date: Fri, 24 Mar 2006 08:28:12 +0000 Subject: [PATCH] Bug 1130: add totempg log; remove warnings; add DPRINT macro git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@954 fd59a12c-fef9-0310-b244-a6a79926bd2f --- Makefile.inc | 2 +- exec/Makefile | 7 +++--- exec/aispoll.c | 2 +- exec/amf.c | 32 +++++++++++------------- exec/amfconfig.c | 2 +- exec/amfconfig.h | 24 +++++++++--------- exec/cfg.c | 2 +- exec/ckpt.c | 29 ++++++---------------- exec/clm.c | 7 +++--- exec/cpg.c | 2 +- exec/evs.c | 2 +- exec/evt.c | 4 +-- exec/keygen.c | 2 +- exec/lck.c | 4 +-- exec/main.c | 2 -- exec/msg.c | 20 ++++++++++++++- exec/print.c | 2 ++ exec/totem.h | 1 + exec/totemconfig.c | 2 +- exec/totemip.c | 3 --- exec/totemnet.c | 8 +++--- exec/totempg.c | 36 ++++++++++++++++++--------- exec/totemsrp.c | 62 +++++++++++++++++++++++++--------------------- exec/totemsrp.h | 5 ---- exec/ykd.c | 4 --- lcr/lcr_ifact.c | 12 ++++++--- lcr/libtest_a.c | 4 +-- lcr/libtest_b.c | 4 +-- lcr/test.c | 8 +++--- lib/amf.c | 7 +++--- lib/clm.c | 3 +-- lib/evt.c | 17 ++++++------- lib/lck.c | 4 +-- lib/util.h | 8 ++++++ test/ckptbench.c | 2 +- test/testamf1.c | 8 +++--- test/testckpt.c | 4 +-- test/testcpg.c | 3 ++- 38 files changed, 185 insertions(+), 165 deletions(-) diff --git a/Makefile.inc b/Makefile.inc index 6945ad20..e9e1e297 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -62,7 +62,7 @@ endif LDFLAGS += endif ifeq (${OPENAIS_BUILD}, DEBUG) - CFLAGS += -O0 -g -Wall + CFLAGS += -O0 -g -Wall -DDEBUG LDFLAGS += -g endif diff --git a/exec/Makefile b/exec/Makefile index 6dc21fa1..fd606ef1 100644 --- a/exec/Makefile +++ b/exec/Makefile @@ -109,7 +109,8 @@ service_cpg.lcrso: cpg.o $(CC) -bundle -bundle_loader ./aisexec -bind_at_load cpg.o -o $@ objdb.lcrso: objdb.o - $(CC) -bundle -bundle_loader ./aisexec -bind_at_looad objdb.o -o $@ + $(CC) -bundle -bundle_loader ./aisexec -bind_at_load objdb.o -o $@ + else service_evs.lcrso: evs.o @@ -142,11 +143,9 @@ service_cpg.lcrso: cpg.o objdb.lcrso: objdb.o $(CC) -shared -Wl,-soname,objdb.lcrso objdb.o -o $@ -aisexec: $(EXEC_OBJS) libtotem_pg.a - endif - +aisexec: $(EXEC_OBJS) libtotem_pg.a $(CC) $(LDFLAGS) $(EXEC_OBJS) $(EXEC_LIBS) -o aisexec libtotem_pg.a: $(TOTEM_OBJS) diff --git a/exec/aispoll.c b/exec/aispoll.c index 37ac96d7..974bcf64 100644 --- a/exec/aispoll.c +++ b/exec/aispoll.c @@ -465,7 +465,7 @@ void poll_print_state ( if (poll_instance->poll_entries[i].ufd.fd == fd) { printf ("fd %d\n", poll_instance->poll_entries[i].ufd.fd); printf ("events %d\n", poll_instance->poll_entries[i].ufd.events); - printf ("dispatch_fn %x\n", poll_instance->poll_entries[i].dispatch_fn); + printf ("dispatch_fn %p\n", poll_instance->poll_entries[i].dispatch_fn); printf ("prio %d\n", poll_instance->poll_entries[i].prio); } } diff --git a/exec/amf.c b/exec/amf.c index b29f5efa..d237523e 100644 --- a/exec/amf.c +++ b/exec/amf.c @@ -1,4 +1,3 @@ -int waiting = 0; /* * Copyright (c) 2002-2006 MontaVista Software, Inc. * @@ -88,6 +87,7 @@ struct invocation { struct invocation *invocation_entries = 0; int invocation_entries_size = 0; +int waiting = 0; enum amf_response_interfaces { AMF_RESPONSE_HEALTHCHECKCALLBACK = 1, @@ -421,7 +421,7 @@ struct lcr_iface openais_amf_ver0[1] = { .dependency_count = 0, .constructor = NULL, .destructor = NULL, - .interfaces = (void **)&amf_service_handler_iface, + .interfaces = (void **)(void *)&amf_service_handler_iface, } }; @@ -524,13 +524,13 @@ void *clc_command_run (void *context) char *argv[10]; char *envp[10]; int status; - unsigned char cmd[1024]; - unsigned char env_comp_binary_name[1024]; - unsigned char env_comp_binary_path[1024]; - unsigned char env_comp_name[1024]; - unsigned char *binary_to_run = 0; - unsigned char *binary_path = 0; - char *clc_cli_interface; + char cmd[1024]; + char env_comp_binary_name[1024]; + char env_comp_binary_path[1024]; + char env_comp_name[1024]; + char *binary_to_run = NULL; + char *binary_path = NULL; + char *clc_cli_interface = NULL; sleep (1); @@ -614,7 +614,7 @@ printf ("waiting for pid %d to finish\n", pid); strcpy (env_comp_name, "SA_AMF_COMPONENT_NAME="); - strncat (env_comp_name, clc_command_run_data->comp->name.value, + strncat (env_comp_name, (char *)clc_command_run_data->comp->name.value, clc_command_run_data->comp->name.length); if (cmd[0] == '\0') { @@ -978,11 +978,11 @@ DECLARE_LIST_INIT (library_notification_send_listhead); // TODO static totempg_recovery_plug_handle amf_recovery_plug_handle; +#ifdef COMPILE_OUT static void protectiongroup_notifications_send ( struct amf_comp *changedComponent, SaAmfProtectionGroupChangesT changeToComponent) { -#ifdef COMPILE_OUT int i; struct conn_info *conn_info; struct list_head *list; @@ -1022,15 +1022,15 @@ static void protectiongroup_notifications_send ( } /* if track flags active */ } /* for all track entries */ } /* for all connection entries */ -#endif } +#endif +#ifdef COMPILE_OUT static int make_protectiongroup_notification_allcomponent ( struct amf_comp *changedComponent, SaAmfProtectionGroupChangesT changeToComponent, SaAmfProtectionGroupNotificationT **notification ) { -#ifdef COMPILE_OUT SaAmfProtectionGroupNotificationT *protectionGroupNotification = 0; int notifyEntries = 0; struct amf_comp *component; @@ -1087,9 +1087,8 @@ static int make_protectiongroup_notification_allcomponent ( *notification = protectionGroupNotification; } return (notifyEntries); -#endif - return (0); } +#endif #ifdef COMPILE_OUT static int make_protectiongroup_notification ( @@ -2822,7 +2821,6 @@ static void message_handler_req_lib_amf_response (void *conn, void *msg) { struct req_lib_amf_response *req_lib_amf_response = (struct req_lib_amf_response *)msg; struct res_lib_amf_response res_lib_amf_response; - struct conn_info *conn_info; struct csi_set_callback_data *csi_set_callback_data; struct csi_remove_callback_data *csi_remove_callback_data; struct component_terminate_callback_data *component_terminate_callback_data; @@ -2843,7 +2841,7 @@ static void message_handler_req_lib_amf_response (void *conn, void *msg) goto error_exit; } - log_printf (LOG_LEVEL_DEBUG, "handling response connection %p interface %x\n", conn_info, interface); + log_printf (LOG_LEVEL_DEBUG, "handling response connection interface %x\n", interface); switch (interface) { case AMF_RESPONSE_HEALTHCHECKCALLBACK: healthcheck_active = (struct healthcheck_active *)data; diff --git a/exec/amfconfig.c b/exec/amfconfig.c index 1074a234..65082117 100644 --- a/exec/amfconfig.c +++ b/exec/amfconfig.c @@ -498,7 +498,7 @@ extern int openais_amf_config_read (char **error_string) case AMF_HEALTHCHECK: if ((loc = strstr_rs (line, "key=")) != 0) { - strcpy (amf_healthcheck->key.key, loc); + strcpy ((char *)amf_healthcheck->key.key, loc); amf_healthcheck->key.keyLen = strlen (loc); } else if ((loc = strstr_rs (line, "period=")) != 0) { diff --git a/exec/amfconfig.h b/exec/amfconfig.h index 602d99a0..b5b72e44 100644 --- a/exec/amfconfig.h +++ b/exec/amfconfig.h @@ -87,8 +87,8 @@ struct amf_unit { SaAmfHAStateT assigned_ha_state; SaAmfHAStateT requested_ha_state; - unsigned char clccli_path[1024]; - unsigned char binary_path[1024]; + char clccli_path[1024]; + char binary_path[1024]; poll_timer_handle restart_timer; int restart_count; @@ -143,8 +143,8 @@ struct amf_group { struct list_head unit_head; struct list_head si_head; - unsigned char clccli_path[1024]; - unsigned char binary_path[1024]; + char clccli_path[1024]; + char binary_path[1024]; unsigned int component_restart_probation; unsigned int component_restart_max; @@ -176,15 +176,15 @@ struct amf_comp { enum clc_component_types comptype; - unsigned char clccli_path[1024]; - unsigned char binary_path[1024]; - unsigned char binary_name[1024]; + char clccli_path[1024]; + char binary_path[1024]; + char binary_name[1024]; - unsigned char instantiate_cmd[1024]; - unsigned char terminate_cmd[1024]; - unsigned char cleanup_cmd[1024]; - unsigned char am_start_cmd[1024]; - unsigned char am_stop_cmd[1024]; + char instantiate_cmd[1024]; + char terminate_cmd[1024]; + char cleanup_cmd[1024]; + char am_start_cmd[1024]; + char am_stop_cmd[1024]; OpenaisCfgAdministrativeStateT administrative_state; OpenaisCfgOperationalStateT operational_state; diff --git a/exec/cfg.c b/exec/cfg.c index 3238252f..4abbbddc 100644 --- a/exec/cfg.c +++ b/exec/cfg.c @@ -164,7 +164,7 @@ struct lcr_iface openais_cfg_ver0[1] = { .dependency_count = 0, .constructor = NULL, .destructor = NULL, - .interfaces = (void **)&cfg_service_handler_iface, + .interfaces = (void **)(void *)&cfg_service_handler_iface, } }; diff --git a/exec/ckpt.c b/exec/ckpt.c index 856c36cc..540c765f 100644 --- a/exec/ckpt.c +++ b/exec/ckpt.c @@ -102,7 +102,7 @@ struct saCkptCheckpoint { int expired; int active_replica_set; int sectionCount; - struct ckpt_refcnt ckpt_refcount[32]; // SHOULD BE PROCESSOR COUNT MAX + struct ckpt_refcnt ckpt_refcount[PROCESSOR_COUNT_MAX]; }; struct iteration_entry { @@ -520,7 +520,7 @@ struct lcr_iface openais_ckpt_ver0[1] = { .dependency_count = 0, .constructor = NULL, .destructor = NULL, - .interfaces = (void **)&ckpt_service_handler_iface, + .interfaces = (void **)(void *)&ckpt_service_handler_iface, } }; @@ -2737,9 +2737,9 @@ static void message_handler_req_exec_ckpt_sectionwrite ( goto error_exit; } -/* - printf ("writing checkpoint section is %s\n", ((char *)req_lib_ckpt_sectionwrite) + sizeof (struct req_lib_ckpt_sectionwrite)); -*/ + log_printf (LOG_LEVEL_DEBUG, "writing checkpoint section is %s\n", + ((char *)req_lib_ckpt_sectionwrite) + sizeof (struct req_lib_ckpt_sectionwrite)); + /* * Find checkpoint section to be written */ @@ -3326,19 +3326,6 @@ static void message_handler_req_lib_ckpt_sectioncreate ( iovecs[1].iov_len); } -#ifdef DEBUG -printf ("LIBRARY SECTIONCREATE string is %s len is %d\n", (unsigned char *)iovecs[1].iov_base, - iovecs[1].iov_len); -printf ("|\n"); -{ int i; - char *abc = iovecs[1].iov_base; -for (i = 0; i < 14;i++) { - - printf ("%c ", abc[i]); -} -} -printf ("|\n"); -#endif if (iovecs[1].iov_len > 0) { log_printf (LOG_LEVEL_DEBUG, "IOV_BASE is %p\n", iovecs[1].iov_base); assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 2, TOTEMPG_AGREED) == 0); @@ -3757,7 +3744,7 @@ static void message_handler_req_lib_ckpt_sectioniterationinitialize ( } res = hdb_handle_get (&ckpt_pd->iteration_hdb, iteration_handle, - (void **)&iteration_instance); + (void **)(void *)&iteration_instance); if (res != 0) { hdb_handle_destroy (&ckpt_pd->iteration_hdb, iteration_handle); goto error_exit; @@ -3841,7 +3828,7 @@ static void message_handler_req_lib_ckpt_sectioniterationfinalize ( res = hdb_handle_get (&ckpt_pd->iteration_hdb, req_lib_ckpt_sectioniterationfinalize->iteration_handle, - (void **)&iteration_instance); + (void **)(void *)&iteration_instance); if (res != 0) { error = SA_AIS_ERR_LIBRARY; goto error_exit; @@ -3884,7 +3871,7 @@ static void message_handler_req_lib_ckpt_sectioniterationnext ( log_printf (LOG_LEVEL_DEBUG, "section iteration next\n"); res = hdb_handle_get (&ckpt_pd->iteration_hdb, req_lib_ckpt_sectioniterationnext->iteration_handle, - (void **)&iteration_instance); + (void **)(void *)&iteration_instance); if (res != 0) { error = SA_AIS_ERR_LIBRARY; goto error_exit; diff --git a/exec/clm.c b/exec/clm.c index c6989973..c0e91d75 100644 --- a/exec/clm.c +++ b/exec/clm.c @@ -231,7 +231,7 @@ struct lcr_iface openais_clm_ver0[1] = { .dependency_count = 0, .constructor = NULL, .destructor = NULL, - .interfaces = (void **)&clm_service_handler_iface, + .interfaces = (void **)(void *)&clm_service_handler_iface, } }; @@ -264,10 +264,10 @@ static int clm_exec_init_fn (struct openais_config *openais_config) sprintf ((char *)thisClusterNode.nodeAddress.value, "%s", totemip_print (this_ip)); thisClusterNode.nodeAddress.length = strlen ((char *)thisClusterNode.nodeAddress.value); if (this_ip->family == AF_INET) { - thisClusterNode.nodeAddress.family = SA_CLM_AF_INET; + thisClusterNode.nodeAddress.family = SA_CLM_AF_INET; } else if (this_ip->family == AF_INET6) { - thisClusterNode.nodeAddress.family = SA_CLM_AF_INET6; + thisClusterNode.nodeAddress.family = SA_CLM_AF_INET6; } else { assert (0); } @@ -275,7 +275,6 @@ static int clm_exec_init_fn (struct openais_config *openais_config) strcpy ((char *)thisClusterNode.nodeName.value, (char *)thisClusterNode.nodeAddress.value); thisClusterNode.nodeName.length = thisClusterNode.nodeAddress.length; thisClusterNode.nodeId = this_ip->nodeid; - printf ("setting B to %x\n", this_ip->nodeid); thisClusterNode.member = 1; { #if defined(OPENAIS_LINUX) diff --git a/exec/cpg.c b/exec/cpg.c index 2fdaceea..47b01311 100644 --- a/exec/cpg.c +++ b/exec/cpg.c @@ -263,7 +263,7 @@ struct lcr_iface openais_cpg_ver0[1] = { .dependency_count = 0, .constructor = NULL, .destructor = NULL, - .interfaces = (void **)&cpg_service_handler_iface, + .interfaces = (void **)(void *)&cpg_service_handler_iface, } }; diff --git a/exec/evs.c b/exec/evs.c index 95e605bd..321a3236 100644 --- a/exec/evs.c +++ b/exec/evs.c @@ -178,7 +178,7 @@ struct lcr_iface openais_evs_ver0[1] = { .dependency_count = 0, .constructor = NULL, .destructor = NULL, - .interfaces = (void **)&evs_service_handler_iface, + .interfaces = (void **)(void *)&evs_service_handler_iface, } }; diff --git a/exec/evt.c b/exec/evt.c index e4d288a4..9d341361 100644 --- a/exec/evt.c +++ b/exec/evt.c @@ -245,7 +245,7 @@ struct lcr_iface openais_evt_ver0[1] = { .dependency_count = 0, .constructor = NULL, .destructor = NULL, - .interfaces = (void **)&evt_service_handler_iface, + .interfaces = (void **)(void *)&evt_service_handler_iface, } }; @@ -3341,7 +3341,7 @@ static void evt_chan_open_finish(struct open_chan_pending *ocp, unsigned int ret = 0; unsigned int timer_del_status = 0; void *ptr = 0; - uint32_t handle; + uint32_t handle = 0; struct libevt_pd *esip; esip = (struct libevt_pd *)openais_conn_private_data_get(ocp->ocp_conn); diff --git a/exec/keygen.c b/exec/keygen.c index f3c2d0d2..23a230ce 100644 --- a/exec/keygen.c +++ b/exec/keygen.c @@ -52,7 +52,7 @@ int main (void) { exit (1); } - printf ("Gathering %lu bits for key from /dev/random.\n", sizeof (key) * 8); + printf ("Gathering %lu bits for key from /dev/random.\n", (unsigned long)(sizeof (key) * 8)); random_fd = open ("/dev/random", O_RDONLY); if (random_fd == -1) { perror ("Is /dev/random present? Opening /dev/random"); diff --git a/exec/lck.c b/exec/lck.c index 74dbb87d..0612f0e7 100644 --- a/exec/lck.c +++ b/exec/lck.c @@ -319,7 +319,7 @@ struct lcr_iface openais_lck_ver0[1] = { .dependency_count = 0, .constructor = NULL, .destructor = NULL, - .interfaces = (void **)&lck_service_handler_iface, + .interfaces = (void **)(void *)&lck_service_handler_iface, } }; @@ -684,7 +684,7 @@ static void message_handler_req_exec_lck_resourceopen ( list_init (&resource_cleanup->list); list_init (&resource_cleanup->resource_lock_list_head); resource_cleanup->resource = resource; -printf ("resource is %p\n", resource); + log_printf (LOG_LEVEL_DEBUG, "resource is %p\n", resource); resource_cleanup->resource_handle = req_exec_lck_resourceopen->resource_handle; list_add ( &resource_cleanup->list, diff --git a/exec/main.c b/exec/main.c index 24b20d0e..5f4d508f 100644 --- a/exec/main.c +++ b/exec/main.c @@ -1020,7 +1020,6 @@ static void aisexec_mempool_init (void) static void aisexec_tty_detach (void) { -#define DEBUG #ifndef DEBUG /* * Disconnect from TTY if this is not a debug run @@ -1039,7 +1038,6 @@ static void aisexec_tty_detach (void) break; } #endif -#undef DEBUG } static void aisexec_libais_bind (int *server_fd) diff --git a/exec/msg.c b/exec/msg.c index d555e0bd..60f0eae1 100644 --- a/exec/msg.c +++ b/exec/msg.c @@ -468,7 +468,7 @@ struct lcr_iface openais_msg_ver0[1] = { .dependency_count = 0, .constructor = NULL, .destructor = NULL, - .interfaces = (void **)&msg_service_handler_iface, + .interfaces = (void **)(void *)&msg_service_handler_iface, } }; @@ -873,18 +873,22 @@ static void message_handler_req_exec_msg_queuestatusget ( void *message, struct totem_ip_address *source_addr) { +#if 0 struct req_exec_msg_queuestatusget *req_exec_msg_queuestatusget = (struct req_exec_msg_queuestatusget *)message; struct res_lib_msg_queueclose res_lib_msg_queuestatusget; +#endif } static void message_handler_req_exec_msg_queueunlink ( void *message, struct totem_ip_address *source_addr) { +#if 0 struct req_exec_msg_queueunlink *req_exec_msg_queueunlink = (struct req_exec_msg_queueunlink *)message; struct res_lib_msg_queueclose res_lib_msg_queueunlink; +#endif } static void message_handler_req_exec_msg_queuegroupcreate ( @@ -1055,63 +1059,77 @@ static void message_handler_req_exec_msg_queuegrouptrack ( void *message, struct totem_ip_address *source_addr) { +#if 0 struct req_exec_msg_queuegrouptrack *req_exec_msg_queuegrouptrack = (struct req_exec_msg_queuegrouptrack *)message; struct res_lib_msg_queueclose res_lib_msg_queuegrouptrack; +#endif } static void message_handler_req_exec_msg_queuegrouptrackstop ( void *message, struct totem_ip_address *source_addr) { +#if 0 struct req_exec_msg_queuegrouptrackstop *req_exec_msg_queuegrouptrackstop = (struct req_exec_msg_queuegrouptrackstop *)message; struct res_lib_msg_queueclose res_lib_msg_queuegrouptrackstop; +#endif } static void message_handler_req_exec_msg_messagesend ( void *message, struct totem_ip_address *source_addr) { +#if 0 struct req_exec_msg_messagesend *req_exec_msg_messagesend = (struct req_exec_msg_messagesend *)message; struct res_lib_msg_queueclose res_lib_msg_messagesend; +#endif } static void message_handler_req_exec_msg_messageget ( void *message, struct totem_ip_address *source_addr) { +#if 0 struct req_exec_msg_messageget *req_exec_msg_messageget = (struct req_exec_msg_messageget *)message; struct res_lib_msg_queueclose res_lib_msg_messageget; +#endif } static void message_handler_req_exec_msg_messagecancel ( void *message, struct totem_ip_address *source_addr) { +#if 0 struct req_exec_msg_messagecancel *req_exec_msg_messagecancel = (struct req_exec_msg_messagecancel *)message; struct res_lib_msg_queueclose res_lib_msg_messagecancel; +#endif } static void message_handler_req_exec_msg_messagesendreceive ( void *message, struct totem_ip_address *source_addr) { +#if 0 struct req_exec_msg_messagesendreceive *req_exec_msg_messagesendreceive = (struct req_exec_msg_messagesendreceive *)message; struct res_lib_msg_queueclose res_lib_msg_messagesendreceive; +#endif } static void message_handler_req_exec_msg_messagereply ( void *message, struct totem_ip_address *source_addr) { +#if 0 struct req_exec_msg_messagereply *req_exec_msg_messagereply = (struct req_exec_msg_messagereply *)message; struct res_lib_msg_queueclose res_lib_msg_messagereply; +#endif } diff --git a/exec/print.c b/exec/print.c index 84fdb9d1..de5db3f4 100644 --- a/exec/print.c +++ b/exec/print.c @@ -185,9 +185,11 @@ void internal_log_printf (int logclass, char *string, ...) } if (logmode & LOG_MODE_FILE && log_file_fp != 0) { fprintf (log_file_fp, "%s", log_string); + fflush (log_file_fp); } if (logmode & LOG_MODE_STDERR) { fprintf (stderr, "%s", log_string); + fflush (stderr); } fflush (stdout); diff --git a/exec/totem.h b/exec/totem.h index 54c4a535..1ec77252 100644 --- a/exec/totem.h +++ b/exec/totem.h @@ -38,6 +38,7 @@ #define MESSAGE_SIZE_MAX 256000 #define PROCESSOR_COUNT_MAX 32 #define FRAME_SIZE_MAX 9000 +#define TRANSMITS_ALLOWED 16 #define SEND_THREADS_MAX 16 /* diff --git a/exec/totemconfig.c b/exec/totemconfig.c index cc71d19b..1f2a3b1f 100644 --- a/exec/totemconfig.c +++ b/exec/totemconfig.c @@ -235,7 +235,7 @@ extern int totem_config_read ( if (interface_max == totem_config->interface_count) { sprintf (error_reason, "%d is too many interfaces in %s/network.conf", - OPENAIS_CONFDIR, totem_config->interface_count); + totem_config->interface_count, OPENAIS_CONFDIR); goto parse_error; } res = totemip_parse (&totem_config->interfaces[totem_config->interface_count].bindnet, loc); diff --git a/exec/totemip.c b/exec/totemip.c index 372bf848..a3628e90 100644 --- a/exec/totemip.c +++ b/exec/totemip.c @@ -355,7 +355,6 @@ int totemip_iface_check(struct totem_ip_address *bindnet, /* Retrieve mask */ if (ioctl(id_fd, SIOCGIFNETMASK, &ifrb) < 0) { - printf ("couldn't do ioctl\n"); break; } intf_addr_mask = (struct sockaddr_in *)&ifrb.ifr_addr; @@ -370,7 +369,6 @@ int totemip_iface_check(struct totem_ip_address *bindnet, /* Get inteface state */ if (ioctl(id_fd, SIOCGIFFLAGS, &ifrb) < 0) { - printf ("couldn't do ioctl\n"); break; } *interface_up = ifrb.ifr_flags & IFF_UP; @@ -379,7 +377,6 @@ int totemip_iface_check(struct totem_ip_address *bindnet, */ #ifdef SIOCGIFINDEX if (ioctl(id_fd, SIOCGIFINDEX, &ifrb) < 0) { - printf ("couldn't do ioctl\n"); break; } *interface_num = ifrb.ifr_index; diff --git a/exec/totemnet.c b/exec/totemnet.c index 075f41e4..ca816f1b 100644 --- a/exec/totemnet.c +++ b/exec/totemnet.c @@ -67,7 +67,7 @@ #include "crypto.h" -#define MCAST_SOCKET_BUFFER_SIZE (16 * 9000) /* where 16 is the transmits allowed, 9000 is mtu size */ +#define MCAST_SOCKET_BUFFER_SIZE (TRANSMITS_ALLOWED * FRAME_SIZE_MAX) #define NETIF_STATE_REPORT_UP 1 #define NETIF_STATE_REPORT_DOWN 2 @@ -84,7 +84,7 @@ struct security_header { } __attribute__((packed)); struct totemnet_mcast_thread_state { - unsigned char iobuf[9000]; + unsigned char iobuf[FRAME_SIZE_MAX]; prng_state prng_state; }; @@ -668,7 +668,8 @@ static int net_deliver_fn ( res = authenticate_and_decrypt (instance, iovec); if (res == -1) { - printf ("Invalid packet data\n"); + instance->totemnet_log_printf (instance->totemnet_log_level_security, + "Invalid packet data\n"); iovec->iov_len = FRAME_SIZE_MAX; return 0; } @@ -1278,7 +1279,6 @@ int totemnet_processor_count_set ( } instance->my_memb_entries = processor_count; -printf ("PCCCCCCCCCCCCCCCCOUNT %d\n", processor_count); poll_timer_delete (instance->totemnet_poll_handle, instance->timer_netif_check_timeout); if (processor_count == 1) { diff --git a/exec/totempg.c b/exec/totempg.c index d9d0fda0..0bab9d23 100644 --- a/exec/totempg.c +++ b/exec/totempg.c @@ -102,6 +102,7 @@ struct totempg_mcast_header { short type; }; + /* * totempg_mcast structure * @@ -139,6 +140,16 @@ static unsigned short mcast_packed_msg_lens[FRAME_SIZE_MAX]; static int mcast_packed_msg_count = 0; +/* + * Function and data used to log messages + */ +static int totempg_log_level_security; +static int totempg_log_level_error; +static int totempg_log_level_warning; +static int totempg_log_level_notice; +static int totempg_log_level_debug; +static void (*totempg_log_printf) (int level, char *format, ...) = NULL; + struct totem_config *totempg_totem_config; struct assembly { @@ -472,13 +483,6 @@ static void totempg_deliver_fn ( iov_len -= 2; } -/* -printf ("Message fragmented %d count %d\n", mcast->fragmented, mcast->msg_count); - for (i = 0; i < mcast->msg_count; i++) { - printf ("len[%d] = %d\n", i, msg_lens[i]); - } -*/ - /* * If the last message in the buffer is a fragment, then we * can't deliver it. We'll first deliver the full messages @@ -489,7 +493,6 @@ printf ("Message fragmented %d count %d\n", mcast->fragmented, mcast->msg_count) continuation = mcast->continuation; iov_delv.iov_base = &assembly->data[0]; iov_delv.iov_len = assembly->index + msg_lens[0]; -// printf ("%d %d %d\n", msg_count, continuation, assembly->last_frag_num); /* * Make sure that if this message is a continuation, that it @@ -505,15 +508,17 @@ printf ("Message fragmented %d count %d\n", mcast->fragmented, mcast->msg_count) if (continuation) { if (continuation != assembly->last_frag_num) { - printf("Message continuation doesn't match previous frag e: %u - a: %u\n", - assembly->last_frag_num, continuation); + totempg_log_printf (totempg_log_level_error, + "Message continuation doesn't match previous frag e: %u - a: %u\n", + assembly->last_frag_num, continuation); continuation = 0; } if ((assembly->index == 0) || (!continuation && assembly->index)) { - printf("Throwing away broken message: continuation %u, index %u\n", - continuation, assembly->index); + totempg_log_printf (totempg_log_level_error, + "Throwing away broken message: continuation %u, index %u\n", + continuation, assembly->index); continuation = 0; } @@ -611,6 +616,12 @@ int totempg_initialize ( int res; totempg_totem_config = totem_config; + totempg_log_level_security = totem_config->totem_logging_configuration.log_level_security; + totempg_log_level_error = totem_config->totem_logging_configuration.log_level_error; + totempg_log_level_warning = totem_config->totem_logging_configuration.log_level_warning; + totempg_log_level_notice = totem_config->totem_logging_configuration.log_level_notice; + totempg_log_level_debug = totem_config->totem_logging_configuration.log_level_debug; + totempg_log_printf = totem_config->totem_logging_configuration.log_printf; fragmentation_data = malloc (TOTEMPG_PACKET_SIZE); if (fragmentation_data == 0) { @@ -879,6 +890,7 @@ int totempg_groups_initialize ( instance->groups = 0; instance->groups_cnt = 0; + hdb_handle_put (&totempg_groups_instance_database, *handle); pthread_mutex_unlock (&totempg_mutex); diff --git a/exec/totemsrp.c b/exec/totemsrp.c index 17af5f0c..924ca284 100644 --- a/exec/totemsrp.c +++ b/exec/totemsrp.c @@ -1,4 +1,3 @@ -#define TRANSMITS_ALLOWED 16 /* * Copyright (c) 2003-2005 MontaVista Software, Inc. * @@ -86,7 +85,7 @@ #define QUEUE_RTR_ITEMS_SIZE_MAX 256 /* allow 512 retransmit items */ #define RETRANS_MESSAGE_QUEUE_SIZE_MAX 500 /* allow 500 messages to be queued */ #define RECEIVED_MESSAGE_QUEUE_SIZE_MAX 500 /* allow 500 messages to be queued */ -#define MAXIOVS 5 +#define MAXIOVS 5 #define RETRANSMIT_ENTRIES_MAX 30 #define MISSING_MCAST_WINDOW 128 @@ -1710,7 +1709,7 @@ int totemsrp_mcast ( } if (queue_is_full (&instance->new_message_queue)) { -printf ("queue full\n"); + instance->totemsrp_log_printf (instance->totemsrp_log_level_warning, "queue full\n"); return (-1); } for (j = 0, i = 0; i < iov_len; i++) { @@ -1823,7 +1822,7 @@ static int orf_token_remcast ( res = sq_in_range (sort_queue, seq); if (res == 0) { -printf ("sq not in range\n"); + instance->totemsrp_log_printf (instance->totemsrp_log_level_debug, "sq not in range\n"); return (-1); } @@ -1859,8 +1858,9 @@ static void messages_free ( unsigned int release_to; unsigned int range = 0; -//printf ("aru %x last aru %x my high delivered %x last releaed %x\n", -// token_aru, instance->my_last_aru, instance->my_high_delivered, instance->last_released); + instance->totemsrp_log_printf (instance->totemsrp_log_level_debug, + "aru %x last aru %x my high delivered %x last released %x\n", + token_aru, instance->my_last_aru, instance->my_high_delivered, instance->last_released); release_to = token_aru; if (sq_lt_compare (instance->my_last_aru, release_to)) { @@ -2127,7 +2127,10 @@ static int orf_token_rtr ( * Add messages to retransmit to RTR list * but only retry if there is room in the retransmit list */ -//printf ("high seq %x aru %x\n", instance->my_high_seq_received, instance->my_aru); + + instance->totemsrp_log_printf (instance->totemsrp_log_level_debug, + "high seq %x aru %x\n", instance->my_high_seq_received, instance->my_aru); + range = instance->my_high_seq_received - instance->my_aru; assert (range < 100000); @@ -2511,7 +2514,8 @@ static void memb_ring_id_create_or_load ( umask(0); fd = open (filename, O_CREAT|O_RDWR, 0777); if (fd == -1) { - printf ("couldn't create file %d %s\n", fd, strerror(errno)); + instance->totemsrp_log_printf (instance->totemsrp_log_level_warning, + "Couldn't create %s %s\n", filename, strerror (errno)); } res = write (fd, &memb_ring_id->seq, sizeof (unsigned long long)); assert (res == sizeof (unsigned long long)); @@ -2696,19 +2700,19 @@ static int message_handler_orf_token ( struct timeval tv_current; struct timeval tv_diff; -gettimeofday (&tv_current, NULL); -timersub (&tv_current, &tv_old, &tv_diff); -memcpy (&tv_old, &tv_current, sizeof (struct timeval)); + gettimeofday (&tv_current, NULL); + timersub (&tv_current, &tv_old, &tv_diff); + memcpy (&tv_old, &tv_current, sizeof (struct timeval)); -if ((((float)tv_diff.tv_usec) / 100.0) > 5.0) { -printf ("OTHERS %0.4f ms\n", ((float)tv_diff.tv_usec) / 100.0); -} + if ((((float)tv_diff.tv_usec) / 100.0) > 5.0) { + printf ("OTHERS %0.4f ms\n", ((float)tv_diff.tv_usec) / 100.0); + } #endif #ifdef RANDOM_DROP -if (random()%100 < 10) { - return (0); -} + if (random()%100 < 10) { + return (0); + } #endif if (endian_conversion_needed) { @@ -2852,7 +2856,8 @@ if (random()%100 < 10) { if (instance->my_aru_count > instance->totem_config->fail_to_recv_const && !totemip_equal(&token->aru_addr, &instance->my_id)) { -printf ("FAILED TO RECEIVE\n"); + instance->totemsrp_log_printf (instance->totemsrp_log_level_error, + "FAILED TO RECEIVE\n"); // TODO if we fail to receive, it may be possible to end with a gather // state of proc == failed = 0 entries memb_set_merge (&token->aru_addr, 1, @@ -2931,12 +2936,12 @@ printf ("FAILED TO RECEIVE\n"); token_send (instance, token, forward_token); #ifdef GIVEINFO -gettimeofday (&tv_current, NULL); -timersub (&tv_current, &tv_old, &tv_diff); -memcpy (&tv_old, &tv_current, sizeof (struct timeval)); -if ((((float)tv_diff.tv_usec) / 100.0) > 5.0) { -printf ("I held %0.4f ms\n", ((float)tv_diff.tv_usec) / 100.0); -} + gettimeofday (&tv_current, NULL); + timersub (&tv_current, &tv_old, &tv_diff); + memcpy (&tv_old, &tv_current, sizeof (struct timeval)); + if ((((float)tv_diff.tv_usec) / 100.0) > 5.0) { + printf ("I held %0.4f ms\n", ((float)tv_diff.tv_usec) / 100.0); + } #endif if (instance->memb_state == MEMB_STATE_OPERATIONAL) { messages_deliver_to_app (instance, 0, @@ -3532,15 +3537,16 @@ static int message_handler_memb_commit_token ( if (memb_commit_token->token_seq > 0 && instance->my_token_seq >= memb_commit_token->token_seq) { - printf ("already received commit token %d %d\n", + instance->totemsrp_log_printf (instance->totemsrp_log_level_notice, + "already received commit token %d %d\n", memb_commit_token->token_seq, instance->my_token_seq); return (0); } */ #ifdef RANDOM_DROP -if (random()%100 < 10) { - return (0); -} + if (random()%100 < 10) { + return (0); + } #endif switch (instance->memb_state) { case MEMB_STATE_OPERATIONAL: diff --git a/exec/totemsrp.h b/exec/totemsrp.h index c094614b..7f944c70 100644 --- a/exec/totemsrp.h +++ b/exec/totemsrp.h @@ -37,11 +37,6 @@ #include "totem.h" #include "aispoll.h" -#define HEADERSIZE 78 - -//#define TOTEMSRP_PACKET_SIZE_MAX 1404 -#define TOTEMSRP_PACKET_SIZE_MAX 9000 - HEADERSIZE - typedef unsigned int totemsrp_handle; /* diff --git a/exec/ykd.c b/exec/ykd.c index e9c028af..d52ee7f8 100644 --- a/exec/ykd.c +++ b/exec/ykd.c @@ -281,14 +281,12 @@ int decide (void) { int i; -printf ("decide 1\n"); /* * Determine if there is a subquorum */ if (subquorum (view_list, view_list_entries, last_primary_max) == 0) { return (0); } -printf ("decide 2\n"); for (i = 0; i < ambiguous_sessions_max_entries; i++) { if (subquorum (view_list, view_list_entries, &ambiguous_sessions_max[i]) == 0) { @@ -296,7 +294,6 @@ printf ("decide 2\n"); } } -printf ("decide 3\n"); return (1); } @@ -356,7 +353,6 @@ static void ykd_deliver_fn ( return; } if (endian_conversion_required) { - printf ("endian convert\n"); ykd_state_endian_convert ((struct ykd_state *)msg_state); } diff --git a/lcr/lcr_ifact.c b/lcr/lcr_ifact.c index 0331d6f8..15aa886e 100644 --- a/lcr/lcr_ifact.c +++ b/lcr/lcr_ifact.c @@ -65,7 +65,11 @@ static struct hdb_handle_database lcr_iface_instance_database = { static unsigned int g_component_handle; +#ifdef OPENAIS_LINUX static int lcr_select_so (const struct dirent *dirent) +#else +static int lcr_select_so (struct dirent *dirent) +#endif { unsigned int len; @@ -85,7 +89,7 @@ static inline struct lcr_component_instance *lcr_comp_find ( int *iface_number) { struct lcr_component_instance *instance; - unsigned int component_handle; + unsigned int component_handle = 0; int i; /* @@ -93,7 +97,7 @@ static inline struct lcr_component_instance *lcr_comp_find ( */ hdb_iterator_reset (&lcr_component_instance_database); while (hdb_iterator_next (&lcr_component_instance_database, - (void **)&instance, &component_handle) == 0) { + (void **)(void *)&instance, &component_handle) == 0) { for (i = 0; i < instance->iface_count; i++) { if ((strcmp (instance->ifaces[i].name, iface_name) == 0) && @@ -113,14 +117,14 @@ static inline int lcr_lib_loaded ( char *library_name) { struct lcr_component_instance *instance; - unsigned int component_handle; + unsigned int component_handle = 0; /* * Try to find interface in already loaded component */ hdb_iterator_reset (&lcr_component_instance_database); while (hdb_iterator_next (&lcr_component_instance_database, - (void **)&instance, &component_handle) == 0) { + (void **)(void *)&instance, &component_handle) == 0) { if (strcmp (instance->library_name, library_name) == 0) { return (1); diff --git a/lcr/libtest_a.c b/lcr/libtest_a.c index bdf8ddf4..7d163629 100644 --- a/lcr/libtest_a.c +++ b/lcr/libtest_a.c @@ -91,7 +91,7 @@ static struct lcr_iface iface1[2] = { .dependency_count = 0, .constructor = iface1_constructor, .destructor = iface1_destructor, - .interfaces = (void **)&iface_list, + .interfaces = (void **)(void *)&iface_list, }, /* version 1 */ { @@ -103,7 +103,7 @@ static struct lcr_iface iface1[2] = { .dependency_count = 0, .constructor = iface1_ver1_constructor, .destructor = iface1_ver1_destructor, - .interfaces = (void **)&iface_ver1_list + .interfaces = (void **)(void *)&iface_ver1_list } }; diff --git a/lcr/libtest_b.c b/lcr/libtest_b.c index 6a3591a6..4d2605aa 100644 --- a/lcr/libtest_b.c +++ b/lcr/libtest_b.c @@ -93,7 +93,7 @@ struct lcr_iface iface1[2]= { .dependency_count = 0, .constructor = iface1_constructor, .destructor = iface1_destructor, - .interfaces = (void **)&iface_list, + .interfaces = (void **)(void *)&iface_list, }, /* * Version 1 @@ -107,7 +107,7 @@ struct lcr_iface iface1[2]= { .dependency_count = 0, .constructor = iface1_ver1_constructor, .destructor = iface1_ver1_destructor, - .interfaces = (void **)&iface_ver1_list + .interfaces = (void **)(void *)&iface_ver1_list } }; diff --git a/lcr/test.c b/lcr/test.c index 2caa2369..461bccea 100644 --- a/lcr/test.c +++ b/lcr/test.c @@ -54,28 +54,28 @@ int main (void) { &a_ifact_handle_ver0, "A_iface1", 0, /* version 0 */ - (void **)&a_iface_ver0, + (void **)(void *)&a_iface_ver0, (void *)0xaaaa0000); lcr_ifact_reference ( &b_ifact_handle_ver0, "B_iface1", 0, /* version 0 */ - (void **)&b_iface_ver0, + (void **)(void *)&b_iface_ver0, (void *)0xbbbb0000); lcr_ifact_reference ( &a_ifact_handle_ver1, "A_iface1", 1, /* version 1 */ - (void **)&a_iface_ver1, + (void **)(void *)&a_iface_ver1, (void *)0xaaaa1111); lcr_ifact_reference ( &b_ifact_handle_ver1, "B_iface1", 1, /* version 1 */ - (void **)&b_iface_ver1, + (void **)(void *)&b_iface_ver1, (void *)0xbbbb1111); a_iface_ver0->func1(); diff --git a/lib/amf.c b/lib/amf.c index 5def5959..e84bc33b 100644 --- a/lib/amf.c +++ b/lib/amf.c @@ -521,7 +521,8 @@ saAmfComponentNameGet ( goto error_exit; } - strcpy (compName->value, env_value); + strncpy ((char *)compName->value, env_value, SA_MAX_NAME_LENGTH-1); + compName->value[SA_MAX_NAME_LENGTH-1] = '\0'; compName->length = strlen (env_value); error_exit: @@ -918,13 +919,13 @@ saAmfComponentErrorReport ( sizeof (SaNameT)); req_lib_amf_componenterrorreport.errorDetectionTime = errorDetectionTime; -printf ("start error report\n"); + DPRINT (("start error report\n")); error = saSendReceiveReply (amfInstance->response_fd, &req_lib_amf_componenterrorreport, sizeof (struct req_lib_amf_componenterrorreport), &res_lib_amf_componenterrorreport, sizeof (struct res_lib_amf_componenterrorreport)); -printf ("end error report\n"); + DPRINT (("end error report\n")); error = res_lib_amf_componenterrorreport.header.error; diff --git a/lib/clm.c b/lib/clm.c index 87cf855f..7294ee02 100644 --- a/lib/clm.c +++ b/lib/clm.c @@ -502,8 +502,7 @@ saClmClusterTrackStop ( req_lib_clm_trackstop.header.size = sizeof (struct req_lib_clm_trackstop); req_lib_clm_trackstop.header.id = MESSAGE_REQ_CLM_TRACKSTOP; -printf ("cluster track stop\n"); - + DPRINT (("cluster track stop\n")); error = saHandleInstanceGet (&clmHandleDatabase, clmHandle, (void *)&clmInstance); if (error != SA_AIS_OK) { diff --git a/lib/evt.c b/lib/evt.c index 80096e8d..573e740e 100644 --- a/lib/evt.c +++ b/lib/evt.c @@ -545,8 +545,8 @@ static SaAisErrorT make_event(SaEvtEventHandleT *event_handle, edi->edi_patterns.patterns[i].allocatedSize = pat->patternSize; edi->edi_patterns.patterns[i].pattern = malloc(pat->patternSize); if (!edi->edi_patterns.patterns[i].pattern) { - printf("make_event: couldn't alloc %llu bytes\n", - (unsigned long long)pat->patternSize); + DPRINT (("make_event: couldn't alloc %llu bytes\n", + (unsigned long long)pat->patternSize)); saHandleDestroy(&event_handle_db, *event_handle); error = SA_AIS_ERR_LIBRARY; goto make_evt_done_put2; @@ -726,7 +726,7 @@ saEvtDispatch( error = saSendRetry(evti->ei_response_fd, &res, sizeof(res)); if (error != SA_AIS_OK) { - printf("MESSAGE_RES_EVT_AVAILABLE: send failed: %d\n", error); + DPRINT (("MESSAGE_RES_EVT_AVAILABLE: send failed: %d\n", error)); pthread_mutex_unlock(&evti->ei_response_mutex); break; } @@ -734,8 +734,7 @@ saEvtDispatch( pthread_mutex_unlock(&evti->ei_response_mutex); if (error != SA_AIS_OK) { - printf("MESSAGE_RES_EVT_AVAILABLE: receive failed: %d\n", - error); + DPRINT (("MESSAGE_RES_EVT_AVAILABLE: receive failed: %d\n", error)); break; } /* @@ -743,7 +742,7 @@ saEvtDispatch( * grabbed it. */ if (evt->led_head.error == SA_AIS_ERR_NOT_EXIST) { - // printf("MESSAGE_RES_EVT_AVAILABLE: No event data\n"); + DPRINT (("MESSAGE_RES_EVT_AVAILABLE: No event data\n")); error = SA_AIS_OK; break; } @@ -760,8 +759,7 @@ saEvtDispatch( if (error == SA_AIS_ERR_TRY_AGAIN) { evti->ei_data_available = 1; } else { - printf("MESSAGE_RES_EVT_AVAILABLE: Error returned: %d\n", - error); + DPRINT (("MESSAGE_RES_EVT_AVAILABLE: Error returned: %d\n", error)); } break; } @@ -816,8 +814,7 @@ saEvtDispatch( break; default: - printf("Dispatch: Bad message type 0x%x\n", - dispatch_data.header.id); + DPRINT (("Dispatch: Bad message type 0x%x\n", dispatch_data.header.id)); error = SA_AIS_ERR_LIBRARY; goto dispatch_put; } diff --git a/lib/lck.c b/lib/lck.c index 0b2095b8..2bca079b 100644 --- a/lib/lck.c +++ b/lib/lck.c @@ -339,7 +339,7 @@ saLckDispatch ( int cont = 1; /* always continue do loop except when set to 0 */ struct message_overlay dispatch_data; struct res_lib_lck_lockwaitercallback *res_lib_lck_lockwaitercallback; - struct res_lib_lck_resourceopenasync *res_lib_lck_resourceopenasync; + struct res_lib_lck_resourceopenasync *res_lib_lck_resourceopenasync = NULL; struct res_lib_lck_resourcelockasync *res_lib_lck_resourcelockasync; struct res_lib_lck_resourceunlockasync *res_lib_lck_resourceunlockasync; @@ -473,7 +473,7 @@ saLckDispatch ( } break; case MESSAGE_RES_LCK_RESOURCELOCKASYNC: -printf ("grant\n"); + DPRINT (("grant\n")); if (callbacks.saLckLockGrantCallback == NULL) { continue; } diff --git a/lib/util.h b/lib/util.h index 160a8603..07bc4b69 100644 --- a/lib/util.h +++ b/lib/util.h @@ -42,6 +42,14 @@ #include "../include/ipc_gen.h" +/* Debug macro + */ +#ifdef DEBUG + #define DPRINT(s) printf s +#else + #define DPRINT(s) +#endif + #ifdef SO_NOSIGPIPE #ifndef MSG_NOSIGNAL #define MSG_NOSIGNAL 0 diff --git a/test/ckptbench.c b/test/ckptbench.c index 0fda6c3d..2cd4f8c5 100644 --- a/test/ckptbench.c +++ b/test/ckptbench.c @@ -232,7 +232,7 @@ int main (void) { "Initial Data #0", strlen ("Initial Data #0") + 1); - size = 200000; + size = 1; for (i = 0; i < 50; i++) { /* number of repetitions - up to 50k */ ckpt_benchmark (checkpointHandle, size); diff --git a/test/testamf1.c b/test/testamf1.c index d2ddeab0..2131c4c0 100644 --- a/test/testamf1.c +++ b/test/testamf1.c @@ -70,8 +70,6 @@ void setSanameT (SaNameT *name, char *str) { memcpy (name->value, str, name->length); } -static int health_flag = -1; -static unsigned int healthcheck_count = 0; static unsigned int healthcheck_no = 0; int stop = 0; @@ -150,6 +148,10 @@ void CSISetCallback ( printf (" requested to enter hastate SA_AMF_STANDBY.\n"); saAmfResponse (handle, invocation, SA_AIS_OK); break; + case SA_AMF_HA_QUIESCED: + break; + case SA_AMF_HA_QUIESCING: + break; } } @@ -157,7 +159,7 @@ void CSIRemoveCallback ( SaInvocationT invocation, const SaNameT *compName, const SaNameT *csiName, - const SaAmfCSIFlagsT *csiFlags) + SaAmfCSIFlagsT csiFlags) { int res; diff --git a/test/testckpt.c b/test/testckpt.c index 9fcf7aca..06cf995a 100644 --- a/test/testckpt.c +++ b/test/testckpt.c @@ -283,7 +283,7 @@ int main (void) { printf ("%s: checkpoint section expiration set\n", get_test_output (error, SA_AIS_OK)); -printf ("Please wait, testing expiry of checkpoint sections.\n"); + printf ("Please wait, testing expiry of checkpoint sections.\n"); do { error = saCkptCheckpointRead (checkpointHandle, ReadVectorElements, @@ -292,7 +292,7 @@ printf ("Please wait, testing expiry of checkpoint sections.\n"); } while (error != SA_AIS_ERR_NOT_EXIST); gettimeofday (&tv_end, NULL); timersub (&tv_end, &tv_start, &tv_elapsed); - printf ("Elapsed Time to expiry is %ld.%ld (should be about %d seconds)\n", tv_elapsed.tv_sec, tv_elapsed.tv_usec, SECONDS_TO_EXPIRE); + printf ("Elapsed Time to expiry is %ld.%ld (should be about %d seconds)\n", tv_elapsed.tv_sec, (unsigned long)tv_elapsed.tv_usec, SECONDS_TO_EXPIRE); error = saCkptCheckpointRetentionDurationSet (checkpointHandle, 5000000000LL); diff --git a/test/testcpg.c b/test/testcpg.c index f972a3e2..dfdfac5d 100644 --- a/test/testcpg.c +++ b/test/testcpg.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -145,7 +146,7 @@ int main (int argc, char *argv[]) { char inbuf[132]; struct iovec iov; - gets(inbuf); + fgets(inbuf, sizeof(inbuf), stdin); if (strncmp(inbuf, "EXIT", 4) == 0) { cpg_leave(handle, &group_name); }