Merge lp:~chasedouglas/geis/looping into lp:geis

Proposed by Chase Douglas
Status: Merged
Merged at revision: 185
Proposed branch: lp:~chasedouglas/geis/looping
Merge into: lp:geis
Diff against target: 26 lines (+7/-2)
1 file modified
libutouch-geis/geis_v1.c (+7/-2)
To merge this branch: bzr merge lp:~chasedouglas/geis/looping
Reviewer Review Type Date Requested Status
Open Input Framework Team Pending
Review via email: mp+88278@code.launchpad.net

Description of the change

This should alleviate the looping and allow the client to unstick itself
after five seconds. I don't know why geis is not sending the init
message though.

Any ideas on how to test that if geis does not send an init message after
five seconds that control returns to the caller?

To post a comment you must log in.
Revision history for this message
Tormod Volden (tormodvolden) wrote :

FWIW I tried your 185 and 186 patches on top of 2.2.2-0ubuntu1. Now eog and evince segfault instead of looping.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libutouch-geis/geis_v1.c'
2--- libutouch-geis/geis_v1.c 2011-10-17 21:17:25 +0000
3+++ libutouch-geis/geis_v1.c 2012-01-11 22:10:27 +0000
4@@ -468,15 +468,20 @@
5 {
6 fd_set read_fds;
7 FD_ZERO(&read_fds);
8- FD_SET(0, &read_fds);
9 FD_SET(geis_fd, &read_fds);
10+ struct timeval timeout = { 5, 0 }; /* wait up to 5 seconds */
11
12- int sstat = select(geis_fd + 1, &read_fds, NULL, NULL, NULL);
13+ int sstat = select(geis_fd + 1, &read_fds, NULL, NULL, &timeout);
14 if (sstat < 0)
15 {
16 fprintf(stderr, "error %d in select(): %s\n", errno, strerror(errno));
17 break;
18 }
19+ else if (sstat == 0)
20+ {
21+ fprintf(stderr, "failed to get init response\n");
22+ break;
23+ }
24
25 if (FD_ISSET(geis_fd, &read_fds))
26 {

Subscribers

People subscribed via source and target branches