summaryrefslogtreecommitdiff
path: root/nbd.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-03-07 11:25:01 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2012-04-19 16:36:43 +0200
commit94e7340b5db8bce7866e44e700ffa8fd26585c7e (patch)
tree4ad990e68ec16c50304bc2996ff4a21d03850f50 /nbd.h
parentdd3e8ac413a74a58d6a3ba16a26952f84370fcff (diff)
nbd: consistently use ssize_t
GCC (pedantically, but correctly) considers that a negative ssize_t may become positive when casted to int. This may cause uninitialized variable warnings when a function returns such a negative ssize_t and is inlined. Propagate ssize_t return types to avoid this. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'nbd.h')
-rw-r--r--nbd.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/nbd.h b/nbd.h
index a8382f096c..217a82d80d 100644
--- a/nbd.h
+++ b/nbd.h
@@ -70,8 +70,8 @@ int unix_socket_incoming(const char *path);
int nbd_receive_negotiate(int csock, const char *name, uint32_t *flags,
off_t *size, size_t *blocksize);
int nbd_init(int fd, int csock, uint32_t flags, off_t size, size_t blocksize);
-int nbd_send_request(int csock, struct nbd_request *request);
-int nbd_receive_reply(int csock, struct nbd_reply *reply);
+ssize_t nbd_send_request(int csock, struct nbd_request *request);
+ssize_t nbd_receive_reply(int csock, struct nbd_reply *reply);
int nbd_client(int fd);
int nbd_disconnect(int fd);