Port to MinGW

Compile-tested only.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
This commit is contained in:
Bart Van Assche
2021-05-23 12:13:59 -07:00
parent ca9c585ef6
commit 70759869ff
5 changed files with 22 additions and 17 deletions

View File

@@ -630,7 +630,8 @@ iscsi_read_from_socket(struct iscsi_context *iscsi)
* no need to limit the read to what is available in the socket
*/
count = hdr_size - in->hdr_pos;
count = recv(iscsi->fd, &in->hdr[in->hdr_pos], count, 0);
count = recv(iscsi->fd, (void *)&in->hdr[in->hdr_pos],
count, 0);
if (count == 0) {
/* remote side has closed the socket. */
return -1;
@@ -681,7 +682,7 @@ iscsi_read_from_socket(struct iscsi_context *iscsi)
}
buf = &in->data[in->data_pos];
}
count = recv(iscsi->fd, buf, count, 0);
count = recv(iscsi->fd, (void *)buf, count, 0);
}
if (count == 0) {
/* remote side has closed the socket. */
@@ -805,7 +806,8 @@ iscsi_write_to_socket(struct iscsi_context *iscsi)
/* Write header and any immediate data */
if (pdu->outdata_written < pdu->outdata.size) {
count = send(iscsi->fd,
pdu->outdata.data + pdu->outdata_written,
(void *)(pdu->outdata.data +
pdu->outdata_written),
pdu->outdata.size - pdu->outdata_written,
socket_flags);
if (count == -1) {