summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Shyti <andi.shyti@samsung.com>2017-02-09 22:20:53 +0900
committerAndi Shyti <andi.shyti@samsung.com>2017-02-09 22:20:53 +0900
commita13923ad9f04059ab3f4c902b388f1fe3a8cc1bd (patch)
treebbae15e16043157a52724f8e92c8a30b1f10f347
parentf01c8010445e76c3b473dfe403bbb9c3347ea4c2 (diff)
stmfts: fix close issue
close if the file is not the right one (strncmp different than '0'), otherwise return because the file is the right one. Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
-rw-r--r--stmfts.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/stmfts.c b/stmfts.c
index 6d59fa2..7de07dd 100644
--- a/stmfts.c
+++ b/stmfts.c
@@ -200,12 +200,12 @@ int stmfts_open_event(char *fname)
}
ret = strncmp(fname, dev_name, STMFTS_INPUT_NAME_SIZE);
- if (ret)
+ if (ret) {
+ close(fd);
continue;
+ }
return fd;
-
- close(fd);
}
error(0, ENODEV, "input device not found");