[PATCH 01/26] lib: fwts_acpid: fix checking of return from read()
Colin King
colin.king at canonical.com
Sun Oct 14 20:31:53 UTC 2012
From: Colin Ian King <colin.king at canonical.com>
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 <colin.king at canonical.com>
---
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;
--
1.7.10.4
More information about the fwts-devel
mailing list