[gpm]Re: patch to avoid possible gpm-1.20.1 segfault

Nico Schottelius nico-gpm@schottelius.org
Wed Sep 17 17:32:08 CEST 2003


applied:
nico@flapp:~/computer/sources/projects/gpm-1.20.1/src $ patch -p2 < ~/gpm-1.20.1.pts.patch 
patching file headers/gpmInt.h
patching file tools.c

updating cvs as soon as I find out my password again... :)

Nico

Eugene Paskevich [Wed, Sep 17, 2003 at 09:34:20AM +0300]:
> Hello, Nico!
> 
>     I've noticed that gpm segfaults while under Midnight Commander.
> Well, it's not gpm who actually faults, but liblow.c.
> mc runs itself connected to /dev/pts/0 (mmm... at least for me).
> When I start mc everything is OK. My mouse is alive and running :).
> Then I press ^O (panels off) gpm as far as I got it reconnects itself to
> /dev/tty*. Switching panels back on leads to segfault of Gpm_get_console
> code because it knows nothing about /dev/pts and returns NULL, which
> in turn leads to a subsequent death of mc. Rather annoying feature to
> leave it as is. ;)
> 
> The patch in attachement made my life a little easier.
> 								Good Luck!
> 
> -- 
> Eugene Paskevich             |   *==(-----------   |     Plug me into
> eugene@raptor.kiev.ua        |   -----------)==*   |      The Matrix

> diff -ruN gpm-1.20.1/src/headers/gpmInt.h gpm-1.20.1-pts/src/headers/gpmInt.h
> --- gpm-1.20.1/src/headers/gpmInt.h	2002-12-25 00:56:54.000000000 +0200
> +++ gpm-1.20.1-pts/src/headers/gpmInt.h	2003-09-17 09:11:13.000000000 +0300
> @@ -82,6 +82,7 @@
>  #define GPM_NULL_DEV         "/dev/null"
>  #define GPM_SYS_CONSOLE      "/dev/console"
>  #define GPM_DEVFS_CONSOLE    "/dev/vc/0"
> +#define GPM_PTS_CONSOLE      "/dev/pts/0"
>  #define GPM_OLD_CONSOLE      "/dev/tty0"
>  
>  /* for adding a mouse; add_mouse */
> diff -ruN gpm-1.20.1/src/tools.c gpm-1.20.1-pts/src/tools.c
> --- gpm-1.20.1/src/tools.c	2002-12-25 00:56:54.000000000 +0200
> +++ gpm-1.20.1-pts/src/tools.c	2003-09-17 09:08:07.000000000 +0300
> @@ -46,6 +46,10 @@
>     if (stat(GPM_DEVFS_CONSOLE,&buf) == 0)
>        tmp = GPM_DEVFS_CONSOLE;
>    
> +   /* May it be that we are on the network console? */
> +   else if(stat(GPM_PTS_CONSOLE,&buf) == 0)
> +      tmp = GPM_PTS_CONSOLE;
> +  
>     /* Failed, try OLD console */
>     else if(stat(GPM_OLD_CONSOLE,&buf) == 0)
>        tmp = GPM_OLD_CONSOLE;


-- 
quote:   there are two time a day you should do nothing: before 12 and after 12
         (Nico Schottelius after writin' a very senseless email)
cmd:     echo God bless America | sed 's/.*\(A.*\)$/Why \1?/'
pgp:     new id: 0x8D0E27A4 | ftp.schottelius.org/pub/family/nico/pgp-key.new
url:     http://nerd-hosting.net - domains for nerds (from a nerd)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.linux.it/pipermail/gpm/attachments/20030917/eea079cd/attachment.bin


More information about the gpm mailing list