Merge lp:~bregma/geis/lp-897976 into lp:geis

Proposed by Stephen M. Webb
Status: Merged
Merged at revision: 179
Proposed branch: lp:~bregma/geis/lp-897976
Merge into: lp:geis
Diff against target: 24 lines (+8/-5)
1 file modified
libutouch-geis/backend/xcb/geis_xcb_backend.c (+8/-5)
To merge this branch: bzr merge lp:~bregma/geis/lp-897976
Reviewer Review Type Date Requested Status
Chase Douglas (community) Approve
Review via email: mp+84845@code.launchpad.net

Description of the change

Fixes a race condition uncovered during utouch-evemu unit testing (LP: #897976).

To post a comment you must log in.
Revision history for this message
Chase Douglas (chasedouglas) wrote :

Looks like the correct fix. I don't see how one could test this reliably, so I'm ok exempting it from needing a testcase.

review: Approve
Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

Yes.

Besides, this is a fix to make failing unit tests pass, so there is an automated test case already.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libutouch-geis/backend/xcb/geis_xcb_backend.c'
2--- libutouch-geis/backend/xcb/geis_xcb_backend.c 2011-10-13 19:26:04 +0000
3+++ libutouch-geis/backend/xcb/geis_xcb_backend.c 2011-12-07 20:57:59 +0000
4@@ -478,12 +478,15 @@
5 static void
6 _report_xcb_devices(GeisXcbBackend be, int deviceid)
7 {
8- XIDeviceInfo *devices;
9- int device_index;
10- int num_devices;
11+ int num_devices;
12+ XIDeviceInfo *devices = XIQueryDevice(be->x11_display, deviceid, &num_devices);
13+ if (devices == NULL)
14+ {
15+ geis_warning("error retrieving device from XIQueryDevice()");
16+ return;
17+ }
18
19- devices = XIQueryDevice(be->x11_display, deviceid, &num_devices);
20- for (device_index = 0; device_index < num_devices; ++device_index)
21+ for (int device_index = 0; device_index < num_devices; ++device_index)
22 {
23 int class_index;
24 for (class_index = 0;

Subscribers

People subscribed via source and target branches