<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
Hello,<br>
<br>
This was sent Tue, 18 Mar 2008 but rejected (probably sent from wrong
email).<br>
<br>
I had to modify libcurses.c from gpm-1.20.3pre3. We use alarm() to
update the screen every 10 seconds. This was causing select() to
return -1 (errno=EINTR). I had to move the test for (flag==-1) before
FD_ISSET(). I couldn't combine the (!flag) and (flag==-1) tests
because I need the GPM_DRAWPOINTER() call. I believe this applies
anywhere select() is called ("sets and timeout become undefined" on
error).<br>
<br>
Also, I added tests for fd<0 and gpm_fd<0. One of these is <
0 if the gpm daemon is restarted. Should gpm_hflag=1 before return?<br>
<br>
Thanks<br>
<br>
Stan Dickerson<br>
Energy Control Systems<br>
<br>
Here is the revised section of libcurses.c:<br>
<br>
<blockquote type="cite"><br>
/*...................................................................*/<br>
if (gpm_fd>=0) /* linux
*/<br>
while(1)<br>
{<br>
if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev);<br>
do<br>
{<br>
FD_ZERO(&selSet);<br>
<b> if (fd < 0) return -1; // added by ECS 2/28/08 for daemon
restart</b><br>
FD_SET(fd,&selSet);<br>
<b> if (gpm_fd < 0) return -1; // added by ECS 2/28/08 for
daemon restart</b><br>
FD_SET(gpm_fd,&selSet);<br>
gpm_timeout.tv_sec=SELECT_TIME;<br>
flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set
*)NULL,&gpm_timeout);<br>
}<br>
while (!flag);<br>
<br>
<b> if (flag==-1) // moved before FD_ISSET() by ECS 2/28/08<br>
continue;</b><br>
<br>
if (FD_ISSET(fd,&selSet))<br>
return GET(win);<br>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Stan Dickerson
Energy Control Systems, Inc.
2940 Cole Court
Norcross, GA 30071
1-800-648-0970
770-448-0651
770-446-1319 fax
</pre>
</body>
</html>