Skip to content

Commit

Permalink
tools: ts_uinput: don't leave an ioctl return value unchecked
Browse files Browse the repository at this point in the history
  • Loading branch information
merge committed Dec 5, 2016
1 parent cac42c4 commit 5a06012
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/ts_uinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ static int process(struct data_t *data, struct ts_sample_mt **s_array, int max_s
static void cleanup(struct data_t *data)
{
int i;
int ret;

if (data->s_array) {
for (i = 0; i < TS_READ_WHOLE_SAMPLES; i++) {
Expand All @@ -415,7 +416,10 @@ static void cleanup(struct data_t *data)
ts_close(data->ts);

if (data->fd_uinput) {
ioctl(data->fd_uinput, UI_DEV_DESTROY);
ret = ioctl(data->fd_uinput, UI_DEV_DESTROY);
if (ret == -1)
perror("ioctl UI_DEV_DESTROY");

close(data->fd_uinput);
}

Expand Down

0 comments on commit 5a06012

Please sign in to comment.