From abac360f324d8c881878c5d9b7fb64be93981125 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Thu, 17 Sep 2009 15:28:41 +0100 Subject: Daemon: fix handling of errors from xread and xwrite. If xread or xwrite returns -1, that indicates an error and we should exit. Note that xread/xwrite has already printed the error message. --- daemon/daemon.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'daemon/daemon.h') diff --git a/daemon/daemon.h b/daemon/daemon.h index 83c9672d..86c68769 100644 --- a/daemon/daemon.h +++ b/daemon/daemon.h @@ -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); -- cgit