Daemon: fix handling of errors from xread and xwrite.
[libguestfs.git] / daemon / daemon.h
index 0ce56e1..86c6876 100644 (file)
@@ -36,8 +36,10 @@ extern int sysroot_len;
 
 extern char *sysroot_path (const char *path);
 
-extern int xwrite (int sock, const void *buf, size_t len);
-extern int xread (int sock, void *buf, size_t len);
+extern int xwrite (int sock, const void *buf, size_t len)
+  __attribute__((__warn_unused_result__));
+extern int xread (int sock, void *buf, size_t len)
+  __attribute__((__warn_unused_result__));
 
 extern int add_string (char ***argv, int *size, int *alloc, const char *str);
 extern int count_strings (char *const *argv);
@@ -116,7 +118,7 @@ extern void cancel_receive (void);
  * Note max write size if GUESTFS_MAX_CHUNK_SIZE.
  */
 extern int send_file_write (const void *buf, int len);
-extern void send_file_end (int cancel);
+extern int send_file_end (int cancel);
 
 /* only call this if there is a FileOut parameter */
 extern void reply (xdrproc_t xdrp, char *ret);