accommodate iov_len of type size_t (i.e., never negative)

* services/pload.c (send_message): Don't test for iov_len < 0,
since it can no longer happen.
* lib/evs.c: Fix a typo in an iov_len-related FIXME comment.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2018 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
Jim Meyering 2009-04-07 18:48:04 +00:00
parent f571a12d9b
commit ce68ee76b9
2 changed files with 6 additions and 6 deletions

View File

@ -472,7 +472,7 @@ evs_error_t evs_mcast_groups (
int i;
evs_error_t error;
struct evs_inst *evs_inst;
struct iovec iov[64];
struct iovec iov[64]; /* FIXME: what if iov_len > 62 ? use malloc */
struct req_lib_evs_mcast_groups req_lib_evs_mcast_groups;
struct res_lib_evs_mcast_groups res_lib_evs_mcast_groups;
int msg_len = 0;

View File

@ -263,7 +263,7 @@ static int send_message (enum totem_callback_token_type type, void *arg)
struct req_exec_pload_mcast req_exec_pload_mcast;
struct iovec iov[2];
unsigned int res;
int iov_len = 2;
int iov_len = 1;
req_exec_pload_mcast.header.id =
SERVICE_ID_MAKE (PLOAD_SERVICE, MESSAGE_REQ_EXEC_PLOAD_MCAST);
@ -271,10 +271,10 @@ static int send_message (enum totem_callback_token_type type, void *arg)
iov[0].iov_base = &req_exec_pload_mcast;
iov[0].iov_len = sizeof (struct req_exec_pload_mcast);
iov[1].iov_base = buffer;
iov[1].iov_len = msg_size - sizeof (struct req_exec_pload_mcast);
if (iov[1].iov_len < 0) {
iov_len = 1;
if (msg_size > sizeof (req_exec_pload_mcast)) {
iov[1].iov_base = buffer;
iov[1].iov_len = msg_size - sizeof (req_exec_pload_mcast);
iov_len = 2;
}
do {