diff options
author | Simon Rettberg | 2015-01-14 13:55:34 +0100 |
---|---|---|
committer | Simon Rettberg | 2015-01-14 13:55:34 +0100 |
commit | f9b94dcafa867c38dfaeb9b24f37b392d1ad80d8 (patch) | |
tree | 9343235020bbdd8a70b4096c54da58c3dfe757ac /src/server/protocol.h | |
parent | [SERVER] Fix stupid bug (not using errno) (diff) | |
download | dnbd3-f9b94dcafa867c38dfaeb9b24f37b392d1ad80d8.tar.gz dnbd3-f9b94dcafa867c38dfaeb9b24f37b392d1ad80d8.tar.xz dnbd3-f9b94dcafa867c38dfaeb9b24f37b392d1ad80d8.zip |
[SERVER] Crank up warning levels of gcc and fix them all (mostly sign compare and some unused params)
Also allow newline at end of alt-servers file without complaining about it
not being a valid alt server definition.
Diffstat (limited to 'src/server/protocol.h')
-rw-r--r-- | src/server/protocol.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/protocol.h b/src/server/protocol.h index b0a1f43..ad286d1 100644 --- a/src/server/protocol.h +++ b/src/server/protocol.h @@ -59,7 +59,7 @@ static inline bool dnbd3_select_image(int sock, char *lower_name, uint16_t rid, iov[0].iov_len = sizeof(request); iov[1].iov_base = &serialized; iov[1].iov_len = len; - return writev( sock, iov, 2 ) == len + sizeof(request); + return writev( sock, iov, 2 ) == len + (ssize_t)sizeof(request); } static inline bool dnbd3_get_block(int sock, uint64_t offset, uint32_t size, uint64_t handle) @@ -95,9 +95,9 @@ static inline bool dnbd3_get_crc32(int sock, uint32_t *master, void *buffer, siz if ( reply.cmd != CMD_GET_CRC32 || reply.size > *bufferLen ) return false; *bufferLen = reply.size; if ( recv( sock, master, sizeof(uint32_t), MSG_WAITALL | MSG_NOSIGNAL ) != sizeof(uint32_t) ) return false; - int done = 0; + uint32_t done = 0; while ( done < reply.size ) { - const int ret = recv( sock, (char*)buffer + done, reply.size - done, 0 ); + const ssize_t ret = recv( sock, (char*)buffer + done, reply.size - done, 0 ); if ( ret <= 0 ) return false; done += ret; } |