diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2018-06-20 07:56:05 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2018-06-20 11:26:57 +1000 |
commit | 7c51c881dc72827ca50ae9eea3d123eef9cb4a66 (patch) | |
tree | c89bc2f7f19863f7d7432b8359f68ded3e11f0fb /tools/shared.c | |
parent | e70e67847c0c52a0a6e4e6d2452a032911356451 (diff) | |
download | libinput-7c51c881dc72827ca50ae9eea3d123eef9cb4a66.tar.gz |
tools: pass a valid grab parameter to list-devices
My kingdome for a compiler warning. Or a scan-build warning. Or a coverity
warning. Or anything... But no, nothing.
Also make the open_restricted() more robust to a NULL userdata, because
effectively that's what we were passing here.
Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/50
Introduced in 0a13223c39fdf0f079715bf83d498c0dcd9cf4f8
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools/shared.c')
-rw-r--r-- | tools/shared.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/shared.c b/tools/shared.c index d1f02702..d3fb6294 100644 --- a/tools/shared.c +++ b/tools/shared.c @@ -232,7 +232,7 @@ open_restricted(const char *path, int flags, void *user_data) if (fd < 0) fprintf(stderr, "Failed to open %s (%s)\n", path, strerror(errno)); - else if (*grab && ioctl(fd, EVIOCGRAB, (void*)1) == -1) + else if (grab && *grab && ioctl(fd, EVIOCGRAB, (void*)1) == -1) fprintf(stderr, "Grab requested, but failed for %s (%s)\n", path, strerror(errno)); |