Skip to content

Commit

Permalink
include: Fix signed/unsigned comparison in qemu_pipe.h
Browse files Browse the repository at this point in the history
../include/system/qemu_pipe.h: In function ‘int qemu_pipe_frame_recv(int, void*, size_t)’:
../include/system/qemu_pipe.h:126:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (ret != size) {
             ^
  • Loading branch information
hadess committed Jul 13, 2016
1 parent 3a12aad commit 3a0433e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/system/qemu_pipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ static int __inline__ qemu_pipe_frame_send(int fd,
// end-of-stream.
static int __inline__ qemu_pipe_frame_recv(int fd, void* buff, size_t len) {
char header[5];
size_t read_ret;
ssize_t ret = TEMP_FAILURE_RETRY(read(fd, header, 4));
if (ret != 4) {
QEMU_PIPE_DEBUG("Can't read qemud frame header: %s", strerror(errno));
Expand All @@ -122,8 +123,8 @@ static int __inline__ qemu_pipe_frame_recv(int fd, void* buff, size_t len) {
len);
return -1;
}
ret = TEMP_FAILURE_RETRY(read(fd, buff, size));
if (ret != size) {
read_ret = TEMP_FAILURE_RETRY(read(fd, buff, size));
if (read_ret != size) {
QEMU_PIPE_DEBUG("Could not read qemud frame payload: %s",
strerror(errno));
return -1;
Expand Down

0 comments on commit 3a0433e

Please sign in to comment.