summaryrefslogtreecommitdiffstats
path: root/src/shared/protocol.h
diff options
context:
space:
mode:
authorSimon Rettberg2017-10-24 11:27:44 +0200
committerSimon Rettberg2017-10-24 11:27:44 +0200
commita0fbfe1c6d6f42b4c2704c882beda1c4cafe5016 (patch)
tree1a962a61adec6f3068cdba1e31129e14b5fada51 /src/shared/protocol.h
parentcmake: Move sample config to /etc/dnbd3-server aswell (diff)
downloaddnbd3-a0fbfe1c6d6f42b4c2704c882beda1c4cafe5016.tar.gz
dnbd3-a0fbfe1c6d6f42b4c2704c882beda1c4cafe5016.tar.xz
dnbd3-a0fbfe1c6d6f42b4c2704c882beda1c4cafe5016.zip
[SERVER] Fix types or add explicit casts everywhere we might have type conversion problems
Diffstat (limited to 'src/shared/protocol.h')
-rw-r--r--src/shared/protocol.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/protocol.h b/src/shared/protocol.h
index c3ccbc1..561e5a1 100644
--- a/src/shared/protocol.h
+++ b/src/shared/protocol.h
@@ -26,7 +26,7 @@
static inline int dnbd3_read_reply(int sock, dnbd3_reply_t *reply, bool wait)
{
- int ret = recv( sock, reply, sizeof(*reply), (wait ? MSG_WAITALL : MSG_DONTWAIT) | MSG_NOSIGNAL );
+ ssize_t ret = recv( sock, reply, sizeof(*reply), (wait ? MSG_WAITALL : MSG_DONTWAIT) | MSG_NOSIGNAL );
if ( ret == 0 ) return REPLY_CLOSED;
if ( ret < 0 ) {
if ( errno == EAGAIN || errno == EWOULDBLOCK ) return REPLY_AGAIN;
@@ -62,7 +62,7 @@ static inline bool dnbd3_select_image(int sock, const char *name, uint16_t rid,
const ssize_t len = serializer_get_written_length( &serialized );
request.magic = dnbd3_packet_magic;
request.cmd = CMD_SELECT_IMAGE;
- request.size = len;
+ request.size = (uint32_t)len;
#ifdef _DEBUG
request.handle = 0;
request.offset = 0;