[PATCH libevdev 2/3] tools: shut up coverity about a potential close(-1)
David Herrmann
dh.herrmann at gmail.com
Sat Dec 26 07:27:29 PST 2015
Hey
On Tue, Dec 22, 2015 at 1:01 AM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
> tools/libevdev-tweak-device.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/tools/libevdev-tweak-device.c b/tools/libevdev-tweak-device.c
> index 4be2d6f..bdc16e6 100644
> --- a/tools/libevdev-tweak-device.c
> +++ b/tools/libevdev-tweak-device.c
> @@ -376,7 +376,8 @@ main(int argc, char **argv)
> int led = -1;
> int led_state = -1;
> unsigned int changes = 0; /* bitmask of changes */
> - int xres, yres;
> + int xres = 0,
> + yres =0;
Missing whitespace and.. rebase mistake? Looks misplaced in this commit.
Thanks
David
> mode = parse_options_mode(argc, argv, &path);
> switch (mode) {
> @@ -434,7 +435,8 @@ main(int argc, char **argv)
>
> out:
> libevdev_free(dev);
> - close(fd);
> + if (fd != -1)
> + close(fd);
>
> return rc;
> }
> --
> 2.5.0
>
> _______________________________________________
> Input-tools mailing list
> Input-tools at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/input-tools
More information about the Input-tools
mailing list