From de824f77fcf7a9164d0e52cf9979c285174426db Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 5 Apr 2018 18:31:22 +0200 Subject: [SHARED] Reset errno --- src/shared/protocol.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/shared') diff --git a/src/shared/protocol.h b/src/shared/protocol.h index 1665e70..6f1cca6 100644 --- a/src/shared/protocol.h +++ b/src/shared/protocol.h @@ -133,10 +133,12 @@ static inline bool dnbd3_get_crc32(int sock, uint32_t *master, void *buffer, siz static inline bool dnbd3_select_image_reply(serialized_buffer_t *buffer, int sock, uint16_t *protocol_version, char **name, uint16_t *rid, uint64_t *imageSize) { + errno = 0; dnbd3_reply_t reply; if ( !dnbd3_get_reply( sock, &reply ) ) { return false; } + errno = 0; if ( reply.cmd != CMD_SELECT_IMAGE || reply.size < 3 || reply.size > MAX_PAYLOAD ) { return false; } -- cgit v1.2.3-55-g7522