Bug#470882: gpm: diff for NMU version 1.20.4-3.1

Thomas Viehmann tv at beamnet.de
Sat Nov 29 23:57:39 UTC 2008


tags 470882 + patch pending
thanks

Hi Peter,

I've prepared an NMU for gpm (versioned as 1.20.4-3.1) and to be
uploaded. It is Thibault's fix. Several reverse dependencies
have already been fixed and more are on the way.

Kind regards

T.

diff -u gpm-1.20.4/debian/changelog gpm-1.20.4/debian/changelog
--- gpm-1.20.4/debian/changelog
+++ gpm-1.20.4/debian/changelog
@@ -1,3 +1,12 @@
+gpm (1.20.4-3.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * debian/patches/060_no_blocking_on_mouse_device_under_x:
+    don't block in rxvt. Closes: #470882
+    Analysis and patch by Samuel Thibault, thanks!
+
+ -- Thomas Viehmann <tv at beamnet.de>  Sat, 29 Nov 2008 23:49:55 +0100
+
 gpm (1.20.4-3) unstable; urgency=low
 
   * Remove myself from Uploaders.
diff -u gpm-1.20.4/debian/patches/series gpm-1.20.4/debian/patches/series
--- gpm-1.20.4/debian/patches/series
+++ gpm-1.20.4/debian/patches/series
@@ -16,0 +17 @@
+060_no_blocking_on_mouse_device_under_x
only in patch2:
unchanged:
--- gpm-1.20.4.orig/debian/patches/060_no_blocking_on_mouse_device_under_x
+++ gpm-1.20.4/debian/patches/060_no_blocking_on_mouse_device_under_x
@@ -0,0 +1,65 @@
+--- a/src/daemon/old_main.c	2008-11-11 22:06:41.000000000 +0100
++++ b/src/daemon/old_main.c	2008-11-11 22:06:25.000000000 +0100
+@@ -130,10 +130,8 @@
+          FD_SET(mouse_table[eventFlag].fd,&selSet);
+       }
+       else
+-         while((pending=select(maxfd+1,&selSet,NULL_SET,NULL_SET,&timeout))==0){
+-            selSet=readySet;
++         if((pending=select(maxfd+1,&selSet,NULL_SET,NULL_SET,&timeout))==0)
+             resetTimeout();
+-         } /* go on */
+ 
+       if(opt_resize) { /* did the console resize? */
+          get_console_size(&event);
+@@ -168,12 +166,24 @@
+       if (ioctl(fd, KDGETMODE, &kd_mode) < 0)
+          gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE);
+       close(fd);
+-      if(kd_mode != KD_TEXT && !option.repeater && !option.force_repeat) {
+-         wait_text(&mouse_table[1].fd);
+-         maxfd=max(maxfd,mouse_table[1].fd);
+-         readySet=connSet;
+-         FD_SET(mouse_table[1].fd,&readySet);
+-         continue; /* reselect */
++      if (!option.repeater && !option.force_repeat) {
++         if (mouse_table[1].fd >= 0 && kd_mode != KD_TEXT) {
++            /* Non-text mode, close mouse */
++            close(mouse_table[1].fd);
++            FD_CLR(mouse_table[1].fd,&readySet);
++            mouse_table[1].fd=-1;
++         } else if (mouse_table[1].fd < 0 && kd_mode == KD_TEXT) {
++            /* Back to text mode, reopen mouse */
++            if ((mouse_table[1].fd=open((mouse_table[1].opt_dev),O_RDWR))<0)
++               gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(mouse_table[1].opt_dev));
++            else {
++               if ((mouse_table[1].m_type)->init)
++                  (mouse_table[1].m_type)=((mouse_table[1].m_type)->init)(mouse_table[1].fd, (mouse_table[1].m_type)->flags, (mouse_table[1].m_type), mouse_argc[1],
++                          mouse_argv[1]);
++               maxfd=max(maxfd,mouse_table[1].fd);
++               FD_SET(mouse_table[1].fd,&readySet);
++            }
++         }
+       }
+       }
+ 
+@@ -185,7 +195,7 @@
+ 
+       for (i=1; i <= 1+opt_double; i++) {
+          which_mouse=mouse_table+i; /* used to access options */
+-         if (FD_ISSET(which_mouse->fd,&selSet)) {
++         if (which_mouse->fd >= 0 && FD_ISSET(which_mouse->fd,&selSet)) {
+             FD_CLR(which_mouse->fd,&selSet); pending--;
+             if (processMouse(which_mouse->fd, &event, (which_mouse->m_type), kd_mode))
+                /* pass it to the client, if any
+--- a/src/headers/gpmInt.h	2008-11-11 22:01:25.000000000 +0100
++++ b/src/headers/gpmInt.h	2008-11-11 22:01:32.000000000 +0100
+@@ -33,7 +33,7 @@
+ 
+ /*....................................... old gpmCfg.h */
+ /* timeout for the select() syscall */
+-#define SELECT_TIME 86400 /* one day */
++#define SELECT_TIME 2 /* two seconds */
+ 
+ #ifdef HAVE_LINUX_TTY_H
+ #include <linux/tty.h>





More information about the pkg-gpm-devel mailing list