[PATCH 01/26] lib: fwts_acpid: fix checking of return from read()
Alex Hung
alex.hung at canonical.com
Mon Oct 15 02:17:23 UTC 2012
On 10/15/2012 04:31 AM, Colin King wrote:
> 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;
>
>
Acked-by: Alex Hung <alex.hung at canonical.com>
More information about the fwts-devel
mailing list