From patchwork Sun Oct 14 20:31:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [01/26] lib: fwts_acpid: fix checking of return from read() Date: Sun, 14 Oct 2012 10:31:53 -0000 From: Colin King X-Patchwork-Id: 191392 Message-Id: <1350246738-31699-2-git-send-email-colin.king@canonical.com> To: fwts-devel@lists.ubuntu.com From: Colin Ian King The return from a read() is of type ssize_t and not size_t and were are currently checking for n < 0 which will never happen if n is a size_t type. So make it ssize_t. Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Keng-Yu Lin --- src/lib/src/fwts_acpid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/src/fwts_acpid.c b/src/lib/src/fwts_acpid.c index 3107052..c7e5c43 100644 --- a/src/lib/src/fwts_acpid.c +++ b/src/lib/src/fwts_acpid.c @@ -77,7 +77,7 @@ char *fwts_acpi_event_read(const int fd, size_t *length, const int timeout) fd_set rfds; int ret; - size_t n; + ssize_t n; size_t size = 0; *length = 0;