mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-08-13 05:49:26 +00:00
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:
parent
f571a12d9b
commit
ce68ee76b9
@ -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;
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user