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
=== modified file 'libutouch-geis/backend/xcb/geis_xcb_backend.c'
--- libutouch-geis/backend/xcb/geis_xcb_backend.c 2011-10-13 19:26:04 +0000
+++ libutouch-geis/backend/xcb/geis_xcb_backend.c 2011-12-07 20:57:59 +0000
@@ -478,12 +478,15 @@
478static void478static void
479_report_xcb_devices(GeisXcbBackend be, int deviceid)479_report_xcb_devices(GeisXcbBackend be, int deviceid)
480{480{
481 XIDeviceInfo *devices;481 int num_devices;
482 int device_index;482 XIDeviceInfo *devices = XIQueryDevice(be->x11_display, deviceid, &num_devices);
483 int num_devices;483 if (devices == NULL)
484 {
485 geis_warning("error retrieving device from XIQueryDevice()");
486 return;
487 }
484488
485 devices = XIQueryDevice(be->x11_display, deviceid, &num_devices);489 for (int device_index = 0; device_index < num_devices; ++device_index)
486 for (device_index = 0; device_index < num_devices; ++device_index)
487 {490 {
488 int class_index;491 int class_index;
489 for (class_index = 0;492 for (class_index = 0;

Subscribers

People subscribed via source and target branches