tools - tweak-device: close the fd on exit

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2015-06-29 11:55:45 +10:00
parent d43413fb3d
commit 269584b1b5

View file

@ -27,6 +27,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
@ -218,7 +219,7 @@ int
main(int argc, char **argv)
{
struct libevdev *dev = NULL;
int fd;
int fd = -1;
int rc = 1;
rc = parse_options(argc, argv);
@ -249,6 +250,7 @@ main(int argc, char **argv)
out:
libevdev_free(dev);
close(fd);
return rc;
}