diff --git a/Makefile.inc b/Makefile.inc index 41cd1179..81ae14dd 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -13,7 +13,7 @@ ifneq "" "$(findstring BSD,$(UNAME))" endif ifeq "$(UNAME)" "SunOS" OPENAIS_COMPAT=SOLARIS - # CC must be set to gcc compiled to link with gnu-ld + # Note that CC must be set to gcc compiled to link with gnu-ld endif ifndef OPENAIS_COMPAT $(error "OPENAIS_COMPAT cannot be detected, it must be manually defined") @@ -41,7 +41,7 @@ LDFLAGS = DYFLAGS = # Adding the TS_CLASS flag enables not being scheduled RR -#CFLAGS += -DTS_CLASS +CFLAGS += -DTS_CLASS # build CFLAGS, LDFLAGS # @@ -91,5 +91,11 @@ ifeq (${OPENAIS_COMPAT}, SOLARIS) override CFLAGS += -DOPENAIS_SOLARIS -D_REENTRANT override LDFLAGS += -lpthread # See http://sources.redhat.com/ml/bug-gnu-utils/2000-07/msg00168.html - override LDFLAGS += -Wl,--export-dynamic + override LDFLAGS += -Wl,--export-dynamic -Wl,-rpath-link=/usr/lib +ifeq ($(shell uname -r), 5.10) + override CFLAGS += -DHAVE_GETPEERUCRED -DHAVE_SCANDIR -DHAVE_ALPHASORT +endif +ifeq ($(shell uname -r), 5.11) + override CFLAGS += -DHAVE_GETPEERUCRED -DHAVE_SCANDIR -DHAVE_ALPHASORT +endif endif diff --git a/exec/amf.c b/exec/amf.c index 7a4ee94c..5d8808cc 100644 --- a/exec/amf.c +++ b/exec/amf.c @@ -672,7 +672,7 @@ static int mcast_sync_data ( req_exec.protocol_version = AMF_PROTOCOL_VERSION; req_exec.object_type = object_type; - iov[0].iov_base = &req_exec; + iov[0].iov_base = (char *)&req_exec; iov[0].iov_len = sizeof (struct req_exec_amf_sync_data); iov[1].iov_base = buf; iov[1].iov_len = len; diff --git a/exec/amfcomp.c b/exec/amfcomp.c index 39955b99..94a6310f 100644 --- a/exec/amfcomp.c +++ b/exec/amfcomp.c @@ -361,7 +361,7 @@ static void *clc_command_run (void *context) waitpid (pid, &status, 0); if (WIFEXITED (status) != 0 && WEXITSTATUS(status) != 0) { fprintf (stderr, "Error: CLC_CLI (%d) failed with exit status:" - " %d - %s\n", pid, WEXITSTATUS(status), + " %d - %s\n", (int)pid, WEXITSTATUS(status), strerror (WEXITSTATUS(status))); /* * Store the exit code from the script in the return data. @@ -370,7 +370,7 @@ static void *clc_command_run (void *context) } if (WIFSIGNALED (status) != 0) { fprintf (stderr, "Error: CLC_CLI (%d) failed with exit status:" - " %d\n", pid, WTERMSIG(status)); + " %d\n", (int)pid, WTERMSIG(status)); /* * TODO: remove this and handle properly later... */ @@ -381,7 +381,7 @@ static void *clc_command_run (void *context) */ } - xprintf ("process (%d) finished with %x\n", pid, status); + xprintf ("process (%d) finished with %x\n", (int)pid, status); if (clc_command_run_data->completion_callback) { clc_command_run_data->completion_callback (context); } diff --git a/exec/amfutil.c b/exec/amfutil.c index 3be32fed..fb9c8158 100644 --- a/exec/amfutil.c +++ b/exec/amfutil.c @@ -1356,7 +1356,7 @@ int amf_msg_mcast (int msg_id, void *buf, size_t len) msg.header.size = sizeof (msg); msg.header.id = SERVICE_ID_MAKE (AMF_SERVICE, msg_id); - iov[0].iov_base = &msg; + iov[0].iov_base = (char *)&msg; iov[0].iov_len = sizeof (msg); if (buf == NULL) { diff --git a/exec/ckpt.c b/exec/ckpt.c index fa62ddb4..e8d4911f 100644 --- a/exec/ckpt.c +++ b/exec/ckpt.c @@ -3473,7 +3473,7 @@ static int sync_checkpoint_section_transmit ( iovecs[0].iov_base = (char *)&req_exec_ckpt_sync_checkpoint_section; iovecs[0].iov_len = sizeof (req_exec_ckpt_sync_checkpoint_section); - iovecs[1].iov_base = checkpoint_section->section_descriptor.section_id.id; + iovecs[1].iov_base = (char *)checkpoint_section->section_descriptor.section_id.id; iovecs[1].iov_len = checkpoint_section->section_descriptor.section_id.id_len; iovecs[2].iov_base = checkpoint_section->section_data; iovecs[2].iov_len = checkpoint_section->section_descriptor.section_size; diff --git a/exec/cpg.c b/exec/cpg.c index 33d9d607..fb81e5b5 100644 --- a/exec/cpg.c +++ b/exec/cpg.c @@ -32,6 +32,9 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef OPENAIS_BSD +#include +#endif #include #include #include @@ -523,7 +526,7 @@ static int cpg_node_joinleave_send (struct group_info *gi, struct process_info * req_exec_cpg_procjoin.header.size = sizeof(req_exec_cpg_procjoin); req_exec_cpg_procjoin.header.id = SERVICE_ID_MAKE(CPG_SERVICE, fn); - req_exec_cpg_iovec.iov_base = &req_exec_cpg_procjoin; + req_exec_cpg_iovec.iov_base = (char *)&req_exec_cpg_procjoin; req_exec_cpg_iovec.iov_len = sizeof(req_exec_cpg_procjoin); result = totempg_groups_mcast_joined (openais_group_handle, &req_exec_cpg_iovec, 1, TOTEMPG_AGREED); @@ -635,7 +638,7 @@ static void cpg_confchg_fn ( /* Don't send this message until we get the final configuration message */ if (configuration_type == TOTEM_CONFIGURATION_REGULAR && req_exec_cpg_downlist.left_nodes) { - req_exec_cpg_iovec.iov_base = &req_exec_cpg_downlist; + req_exec_cpg_iovec.iov_base = (char *)&req_exec_cpg_downlist; req_exec_cpg_iovec.iov_len = req_exec_cpg_downlist.header.size; totempg_groups_mcast_joined (openais_group_handle, &req_exec_cpg_iovec, 1, TOTEMPG_AGREED); @@ -1099,9 +1102,9 @@ static void message_handler_req_lib_cpg_mcast (void *conn, void *message) memcpy(&req_exec_cpg_mcast.group_name, &gi->group_name, sizeof(mar_cpg_name_t)); - req_exec_cpg_iovec[0].iov_base = &req_exec_cpg_mcast; + req_exec_cpg_iovec[0].iov_base = (char *)&req_exec_cpg_mcast; req_exec_cpg_iovec[0].iov_len = sizeof(req_exec_cpg_mcast); - req_exec_cpg_iovec[1].iov_base = &req_lib_cpg_mcast->message; + req_exec_cpg_iovec[1].iov_base = (char *)&req_lib_cpg_mcast->message; req_exec_cpg_iovec[1].iov_len = msglen; // TODO: guarantee type... diff --git a/exec/ipc.c b/exec/ipc.c index 61efb889..48c0f50d 100644 --- a/exec/ipc.c +++ b/exec/ipc.c @@ -54,6 +54,9 @@ #include #include #include +#if defined(OPENAIS_SOLARIS) && defined(HAVE_GETPEERUCRED) +#include +#endif #include "../include/saAis.h" #include "../include/list.h" @@ -79,6 +82,10 @@ #include "util.h" +#ifdef OPENAIS_SOLARIS +#define MSG_NOSIGNAL 0 +#endif + #define SERVER_BACKLOG 5 /* @@ -565,15 +572,17 @@ retry_poll: return (0); } -#if defined(OPENAIS_LINUX) +#if defined(OPENAIS_LINUX) || defined(OPENAIS_SOLARIS) /* SUN_LEN is broken for abstract namespace */ #define AIS_SUN_LEN(a) sizeof(*(a)) - -char *socketname = "libais.socket"; #else #define AIS_SUN_LEN(a) SUN_LEN(a) +#endif +#if defined(OPENAIS_LINUX) +char *socketname = "libais.socket"; +#else char *socketname = "/var/run/libais.socket"; #endif @@ -653,9 +662,14 @@ static int conn_info_outq_flush (struct conn_info *conn_info) { msg_send.msg_name = 0; msg_send.msg_namelen = 0; msg_send.msg_iovlen = 1; +#ifndef OPENAIS_SOLARIS msg_send.msg_control = 0; msg_send.msg_controllen = 0; msg_send.msg_flags = 0; +#else + msg_send.msg_accrights = 0; + msg_send.msg_accrightslen = 0; +#endif while (!queue_is_empty (outq)) { queue_item = queue_item_get (outq); @@ -721,9 +735,6 @@ static void libais_deliver (struct conn_info *conn_info) char cmsg_cred[CMSG_SPACE (sizeof (struct ucred))]; struct ucred *cred; int on = 0; -#else - uid_t euid; - gid_t egid; #endif int send_ok = 0; int send_ok_joined = 0; @@ -734,6 +745,7 @@ static void libais_deliver (struct conn_info *conn_info) msg_recv.msg_iovlen = 1; msg_recv.msg_name = 0; msg_recv.msg_namelen = 0; +#ifndef OPENAIS_SOLARIS msg_recv.msg_flags = 0; if (conn_info->authenticated) { @@ -741,13 +753,14 @@ static void libais_deliver (struct conn_info *conn_info) msg_recv.msg_controllen = 0; } else { #ifdef OPENAIS_LINUX + uid_t euid = -1; + gid_t egid = -1; msg_recv.msg_control = (void *)cmsg_cred; msg_recv.msg_controllen = sizeof (cmsg_cred); #else - euid = -1; egid = -1; if (getpeereid(conn_info->fd, &euid, &egid) != -1 && (euid == 0 || egid == g_gid_valid)) { - conn_info->authenticated = 1; + conn_info->authenticated = 1; } if (conn_info->authenticated == 0) { log_printf (LOG_LEVEL_SECURITY, "Connection not authenticated because gid is %d, expecting %d\n", egid, g_gid_valid); @@ -755,6 +768,36 @@ static void libais_deliver (struct conn_info *conn_info) #endif } +#else /* OPENAIS_SOLARIS */ + msg_recv.msg_accrights = 0; + msg_recv.msg_accrightslen = 0; + + if (! conn_info->authenticated) { +#ifdef HAVE_GETPEERUCRED + ucred_t *uc; + uid_t euid = -1; + gid_t egid = -1; + if (getpeerucred(conn_info->fd, &uc) == 0) { + euid = ucred_geteuid(uc); + egid = ucred_getegid(uc); + if ((euid == 0) || (egid == g_gid_valid)) { + conn_info->authenticated = 1; + } + ucred_free(uc); + } + if (conn_info->authenticated == 0) { + log_printf (LOG_LEVEL_SECURITY, "Connection not authenticated because gid is %d, expecting %d\n", (int)egid, g_gid_valid); + } +#else + log_printf (LOG_LEVEL_SECURITY, "Connection not authenticated " + "because platform does not support " + "authentication with sockets, continuing " + "with a fake authentication\n"); + conn_info->authenticated = 1; +#endif + } +#endif + iov_recv.iov_base = &conn_info->inb[conn_info->inb_start]; iov_recv.iov_len = (SIZEINB) - conn_info->inb_start; if (conn_info->inb_inuse == SIZEINB) { @@ -835,7 +878,7 @@ retry_recv: * to queue a message, otherwise tell the library we are busy and to * try again later */ - send_ok_joined_iovec.iov_base = header; + send_ok_joined_iovec.iov_base = (char *)header; send_ok_joined_iovec.iov_len = header->size; send_ok_joined = totempg_groups_send_ok_joined (openais_group_handle, &send_ok_joined_iovec, 1); @@ -1107,9 +1150,14 @@ int openais_conn_send_response ( msg_send.msg_name = 0; msg_send.msg_namelen = 0; msg_send.msg_iovlen = 1; +#ifndef OPENAIS_SOLARIS msg_send.msg_control = 0; msg_send.msg_controllen = 0; msg_send.msg_flags = 0; +#else + msg_send.msg_accrights = 0; + msg_send.msg_accrightslen = 0; +#endif if (queue_is_full (outq)) { /* diff --git a/exec/sync.c b/exec/sync.c index f741750b..0981595d 100644 --- a/exec/sync.c +++ b/exec/sync.c @@ -391,9 +391,9 @@ static void sync_deliver_fn ( { int i; int barrier_completed; - sync_msg_t *msg = iovec[0].iov_base; + sync_msg_t *msg = (sync_msg_t *)iovec[0].iov_base; - ENTER("type %d, len %d", msg->header.id, iovec[0].iov_len); + ENTER("type %d, len %d", msg->header.id, (int)iovec[0].iov_len); if (endian_conversion_required) { swab_mar_req_header_t (&msg->header); diff --git a/exec/totemip.c b/exec/totemip.c index b82b09c8..76501f00 100644 --- a/exec/totemip.c +++ b/exec/totemip.c @@ -186,6 +186,7 @@ int totemip_compare(const void *a, const void *b) * Family not set, should be! */ assert (0); + exit (1); } } diff --git a/exec/totemnet.c b/exec/totemnet.c index 0eaf54e9..7d195cd5 100644 --- a/exec/totemnet.c +++ b/exec/totemnet.c @@ -1106,6 +1106,7 @@ static int totemnet_build_sockets_ip ( } } +#ifndef OPENAIS_SOLARIS /* * Bind to a specific interface for multicast send and receive */ @@ -1135,6 +1136,7 @@ static int totemnet_build_sockets_ip ( } break; } +#endif return 0; } diff --git a/include/queue.h b/include/queue.h index fd1d759f..c9316600 100644 --- a/include/queue.h +++ b/include/queue.h @@ -38,6 +38,10 @@ #include #include "assert.h" +#ifdef OPENAIS_SOLARIS +/* struct queue is already defined in sys/stream.h on Solaris */ +#define queue _queue +#endif struct queue { int head; int tail; diff --git a/lcr/lcr_ifact.c b/lcr/lcr_ifact.c index 5a2ce254..2ce0e45a 100644 --- a/lcr/lcr_ifact.c +++ b/lcr/lcr_ifact.c @@ -264,7 +264,7 @@ static int ldso_path_build (char *path, char *filename) return (0); } -#ifdef OPENAIS_SOLARIS +#ifndef HAVE_SCANDIR static int scandir ( const char *dir, struct dirent ***namelist, int (*filter)(const struct dirent *), @@ -331,7 +331,9 @@ fail: return -1; } } +#endif +#ifndef HAVE_ALPHASORT static int alphasort (const struct dirent **a, const struct dirent **b) { return strcmp ((*a)->d_name, (*b)->d_name); diff --git a/lib/cpg.c b/lib/cpg.c index 47bca107..996c83d9 100644 --- a/lib/cpg.c +++ b/lib/cpg.c @@ -412,7 +412,7 @@ cpg_error_t cpg_join ( marshall_to_mar_cpg_name_t (&req_lib_cpg_trackstart.group_name, group); - iov[0].iov_base = &req_lib_cpg_trackstart; + iov[0].iov_base = (char *)&req_lib_cpg_trackstart; iov[0].iov_len = sizeof (struct req_lib_cpg_trackstart); error = saSendMsgReceiveReply (cpg_inst->dispatch_fd, iov, 1, @@ -430,7 +430,7 @@ cpg_error_t cpg_join ( marshall_to_mar_cpg_name_t (&req_lib_cpg_join.group_name, group); - iov[0].iov_base = &req_lib_cpg_join; + iov[0].iov_base = (char *)&req_lib_cpg_join; iov[0].iov_len = sizeof (struct req_lib_cpg_join); error = saSendMsgReceiveReply (cpg_inst->response_fd, iov, 1, @@ -471,7 +471,7 @@ cpg_error_t cpg_leave ( marshall_to_mar_cpg_name_t (&req_lib_cpg_leave.group_name, group); - iov[0].iov_base = &req_lib_cpg_leave; + iov[0].iov_base = (char *)&req_lib_cpg_leave; iov[0].iov_len = sizeof (struct req_lib_cpg_leave); pthread_mutex_lock (&cpg_inst->response_mutex); @@ -522,7 +522,7 @@ cpg_error_t cpg_mcast_joined ( req_lib_cpg_mcast.guarantee = guarantee; req_lib_cpg_mcast.msglen = msg_len; - iov[0].iov_base = &req_lib_cpg_mcast; + iov[0].iov_base = (char *)&req_lib_cpg_mcast; iov[0].iov_len = sizeof (struct req_lib_cpg_mcast); memcpy (&iov[1], iovec, iov_len * sizeof (struct iovec)); @@ -572,7 +572,7 @@ cpg_error_t cpg_membership_get ( marshall_to_mar_cpg_name_t (&req_lib_cpg_membership_get.group_name, group_name); - iov.iov_base = &req_lib_cpg_membership_get; + iov.iov_base = (char *)&req_lib_cpg_membership_get; iov.iov_len = sizeof (mar_req_header_t); pthread_mutex_lock (&cpg_inst->response_mutex); diff --git a/test/clc_cli_script b/test/clc_cli_script index 9b42d721..2959de1d 100755 --- a/test/clc_cli_script +++ b/test/clc_cli_script @@ -34,7 +34,7 @@ instantiate() { # echo clc_cli_script instantiating component $SA_AMF_COMPONENT_NAME $1 - ./openais-instantiate $1 + openais-instantiate $1 exit $? } diff --git a/test/cpgbench.c b/test/cpgbench.c index 6d09eed2..bdc99289 100644 --- a/test/cpgbench.c +++ b/test/cpgbench.c @@ -53,6 +53,18 @@ #include "saAis.h" #include "cpg.h" +#ifdef OPENAIS_SOLARIS +#define timersub(a, b, result) \ + do { \ + (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ + (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ + if ((result)->tv_usec < 0) { \ + --(result)->tv_sec; \ + (result)->tv_usec += 1000000; \ + } \ + } while (0) +#endif + int alarm_notice; void cpg_bm_confchg_fn ( diff --git a/test/testamf1.c b/test/testamf1.c index cfe577a9..f24e1327 100644 --- a/test/testamf1.c +++ b/test/testamf1.c @@ -83,7 +83,7 @@ static void _die (char *file, int line, char *format, ...) va_list ap; sprintf (buf, "%d - %s:#%d - Error: '%s', exiting...\n", - getpid(), file, line, format); + (int)getpid(), file, line, format); va_start (ap, format); vfprintf (stderr, buf, ap); @@ -100,7 +100,7 @@ static void response ( do { result = saAmfResponse (handle, invocation, error); if (result == SA_AIS_ERR_TRY_AGAIN) { - fprintf(stderr, "%d: TRY_AGAIN received\n", getpid()); + fprintf(stderr, "%d: TRY_AGAIN received\n", (int)getpid()); usleep (100000); } } while (result == SA_AIS_ERR_TRY_AGAIN); @@ -397,7 +397,7 @@ static SaSelectionObjectT comp_init () do { result = saAmfInitialize (&handle, &amfCallbacks, &version); if (result == SA_AIS_ERR_TRY_AGAIN) { - printf("%d: TRY_AGAIN received\n", getpid()); + printf("%d: TRY_AGAIN received\n", (int)getpid()); usleep (100000); } } while (result == SA_AIS_ERR_TRY_AGAIN); @@ -408,7 +408,7 @@ static SaSelectionObjectT comp_init () do { result = saAmfSelectionObjectGet (handle, &select_fd); if (result == SA_AIS_ERR_TRY_AGAIN) { - printf("%d: TRY_AGAIN received\n", getpid()); + printf("%d: TRY_AGAIN received\n", (int)getpid()); usleep (100000); } } while (result == SA_AIS_ERR_TRY_AGAIN); @@ -419,7 +419,7 @@ static SaSelectionObjectT comp_init () do { result = saAmfComponentNameGet (handle, &compNameGlobal); if (result == SA_AIS_ERR_TRY_AGAIN) { - printf("%d: TRY_AGAIN received\n", getpid()); + printf("%d: TRY_AGAIN received\n", (int)getpid()); usleep (100000); } } while (result == SA_AIS_ERR_TRY_AGAIN); @@ -435,7 +435,7 @@ static SaSelectionObjectT comp_init () SA_AMF_HEALTHCHECK_AMF_INVOKED, SA_AMF_COMPONENT_FAILOVER); if (result == SA_AIS_ERR_TRY_AGAIN) { - printf("%d: TRY_AGAIN received\n", getpid()); + printf("%d: TRY_AGAIN received\n", (int)getpid()); usleep (100000); } } while (result == SA_AIS_ERR_TRY_AGAIN); @@ -450,7 +450,7 @@ static SaSelectionObjectT comp_init () SA_AMF_HEALTHCHECK_COMPONENT_INVOKED, SA_AMF_COMPONENT_FAILOVER); if (result == SA_AIS_ERR_TRY_AGAIN) { - printf("%d: TRY_AGAIN received\n", getpid()); + printf("%d: TRY_AGAIN received\n", (int)getpid()); usleep (100000); } } while (result == SA_AIS_ERR_TRY_AGAIN); @@ -465,7 +465,7 @@ static SaSelectionObjectT comp_init () do { result = saAmfComponentRegister (handle, &badname, NULL); if (result == SA_AIS_ERR_TRY_AGAIN) { - printf("%d: TRY_AGAIN received\n", getpid()); + printf("%d: TRY_AGAIN received\n", (int)getpid()); usleep (100000); } } while (result == SA_AIS_ERR_TRY_AGAIN); @@ -477,7 +477,7 @@ static SaSelectionObjectT comp_init () do { result = saAmfComponentRegister (handle, &compNameGlobal, NULL); if (result == SA_AIS_ERR_TRY_AGAIN) { - printf("%d: TRY_AGAIN received\n", getpid()); + printf("%d: TRY_AGAIN received\n", (int)getpid()); usleep (100000); } } while (result == SA_AIS_ERR_TRY_AGAIN); @@ -495,7 +495,7 @@ static SaSelectionObjectT comp_init () SA_AMF_HEALTHCHECK_AMF_INVOKED, SA_AMF_COMPONENT_FAILOVER); if (result == SA_AIS_ERR_TRY_AGAIN) { - printf("%d: TRY_AGAIN received\n", getpid()); + printf("%d: TRY_AGAIN received\n", (int)getpid()); usleep (100000); } } while (result == SA_AIS_ERR_TRY_AGAIN); @@ -517,31 +517,31 @@ static void handle_intr (void) die ("saAmfFinalize failed %d", result); } fprintf(stderr, "%d: %s exiting\n", - getpid(), compNameGlobal.value); + (int)getpid(), compNameGlobal.value); exit (EXIT_SUCCESS); break; case UNREGISTER: fprintf(stderr, "%d: %s unregistering\n", - getpid(), compNameGlobal.value); + (int)getpid(), compNameGlobal.value); result = saAmfComponentUnregister ( handle, &compNameGlobal, NULL); if (result != SA_AIS_OK) { die ("saAmfComponentUnregister failed %d", result); } - fprintf(stderr, "%d: waiting after unregister\n", getpid()); + fprintf(stderr, "%d: waiting after unregister\n", (int)getpid()); while (1) { sleep (100000000); } break; case ERROR_REPORT: fprintf(stderr, "%d: %s error reporting\n", - getpid(), compNameGlobal.value); + (int)getpid(), compNameGlobal.value); result = saAmfComponentErrorReport ( handle, &compNameGlobal, 0, SA_AMF_COMPONENT_RESTART, 0); if (result != SA_AIS_OK) { die ("saAmfComponentErrorReport failed %d", result); } - fprintf(stderr, "%d: waiting after error report\n", getpid()); + fprintf(stderr, "%d: waiting after error report\n", (int)getpid()); while (1) { sleep (100000000); } @@ -577,7 +577,7 @@ int main (int argc, char **argv) do { result = saAmfDispatch (handle, SA_DISPATCH_ALL); if (result == SA_AIS_ERR_TRY_AGAIN) { - fprintf(stderr, "%d: TRY_AGAIN received\n", getpid()); + fprintf(stderr, "%d: TRY_AGAIN received\n", (int)getpid()); usleep (100000); } } while (result == SA_AIS_ERR_TRY_AGAIN); @@ -591,7 +591,7 @@ int main (int argc, char **argv) result = saAmfHealthcheckConfirm (handle, &compNameGlobal, &keyCompInvoked, SA_AIS_OK); if (result == SA_AIS_ERR_TRY_AGAIN) { - fprintf(stderr, "%d: TRY_AGAIN received\n", getpid()); + fprintf(stderr, "%d: TRY_AGAIN received\n", (int)getpid()); usleep (100000); } } while (result == SA_AIS_ERR_TRY_AGAIN); @@ -602,7 +602,7 @@ int main (int argc, char **argv) } } while (stop == 0); - fprintf(stderr, "%d: exiting...\n", getpid()); + fprintf(stderr, "%d: exiting...\n", (int)getpid()); exit (EXIT_SUCCESS); }