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);
#endif
/* Read the length word. */
- xread (sock, lenbuf, 4);
+ if (xread (sock, lenbuf, 4) == -1)
+ exit (1);
+
xdrmem_create (&xdr, lenbuf, 4, XDR_DECODE);
xdr_uint32_t (&xdr, &len);
xdr_destroy (&xdr);
continue;
}
- xread (sock, buf, len);
+ if (xread (sock, buf, len) == -1)
+ exit (1);
#ifdef ENABLE_PACKET_DUMP
if (verbose) {
for (;;) {
/* Read the length word. */
- xread (sock, lenbuf, 4);
+ if (xread (sock, lenbuf, 4) == -1)
+ exit (1);
+
xdrmem_create (&xdr, lenbuf, 4, XDR_DECODE);
xdr_uint32_t (&xdr, &len);
xdr_destroy (&xdr);
return -1;
}
- xread (sock, buf, len);
+ if (xread (sock, buf, len) == -1)
+ exit (1);
xdrmem_create (&xdr, buf, len, XDR_DECODE);
memset (&chunk, 0, sizeof chunk);
/* Read the message from the daemon. */
r = xread (sock, buf, sizeof buf);
- if (r == -1) {
- perror ("read");
+ if (r == -1)
return 0;
- }
xdrmem_create (&xdr, buf, sizeof buf, XDR_DECODE);
xdr_uint32_t (&xdr, &flag);