mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2026-04-14 17:00:43 +02:00
tools - tweak-device: close the fd on exit
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
d43413fb3d
commit
269584b1b5
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue