Merge lp:~peter-hutterer/evemu/evemu-record-refuse-grab into lp:evemu

Proposed by Peter Hutterer
Status: Merged
Approved by: Stephen M. Webb
Approved revision: 66
Merged at revision: 66
Proposed branch: lp:~peter-hutterer/evemu/evemu-record-refuse-grab
Merge into: lp:evemu
Diff against target: 16 lines (+6/-0)
1 file modified
tools/evemu-record.c (+6/-0)
To merge this branch: bzr merge lp:~peter-hutterer/evemu/evemu-record-refuse-grab
Reviewer Review Type Date Requested Status
Stephen M. Webb (community) Approve
PS Jenkins bot continuous-integration Pending
Review via email:

Description of the change

if evemu-record cannot get an EVIOCGRAB on the fd, refuse to record events and print an error to prevent users from attaching empty event logs to bugs

To post a comment you must log in.
Revision history for this message
Stephen M. Webb (bregma) wrote :


review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tools/evemu-record.c'
2--- tools/evemu-record.c 2012-03-23 15:38:02 +0000
3+++ tools/evemu-record.c 2013-01-08 03:36:20 +0000
4@@ -70,6 +70,12 @@
5 return -1;
6 }
8+ if (ioctl(fd, EVIOCGRAB, (void*)1) < 0) {
9+ fprintf(stderr, "error: this device is grabbed and I cannot record events\n");
10+ return -1;
11+ } else
12+ ioctl(fd, EVIOCGRAB, (void*)0);
14 struct sigaction act;
15 memset (&act, '\0', sizeof(act));
16 act.sa_handler = &handler;


People subscribed via source and target branches