Re: [PATCH 1/2] android/client: Add source command to haltest

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jerzy,

On Thu, Oct 24, 2013 at 3:46 PM, Jerzy Kasenberg
<jerzy.kasenberg@xxxxxxxxx> wrote:
> New command allows to read script file into tool and
> execute its contents as if it was typed.
> ---
>  android/client/haltest.c |   50 +++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 49 insertions(+), 1 deletion(-)
>
> diff --git a/android/client/haltest.c b/android/client/haltest.c
> index 189af0b..efed16e 100644
> --- a/android/client/haltest.c
> +++ b/android/client/haltest.c
> @@ -157,11 +157,47 @@ static void quit_p(int argc, const char **argv)
>         exit(0);
>  }
>
> +static int fd_stack[10];
> +static int fd_stack_pointer = 0;
> +
> +static void stdin_handler(struct pollfd *pollfd);
> +
> +static void process_file(const char *name)
> +{
> +       int fd = open(name, O_RDONLY);
> +
> +       if (fd == -1) {
> +               haltest_error("Can't open file: %s for reading\n", name);
> +               return;
> +       }

Usually for int returns we check errors with < 0, so please change the
code above to follow this practice.



-- 
Luiz Augusto von Dentz
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux