[PATCH 01/26] lib: fwts_acpid: fix checking of return from read()

Keng-Yu Lin kengyu at canonical.com
Wed Oct 17 07:37:55 UTC 2012


On Mon, Oct 15, 2012 at 4:31 AM, Colin King <colin.king at canonical.com> 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;
>
> --
> 1.7.10.4
>
Acked-by: Keng-Yu Lin <kengyu at canonical.com>



More information about the fwts-devel mailing list