[GRASS5] Driver Update

Glynn Clements glynn.clements at virgin.net
Wed May 2 04:00:17 EDT 2001


Justin Hickey wrote:

> > I've commited an update to
> > src/display/devices/lib/command.c which checks the return value from
> > the write() call, in case that's failing for some reason.
> 
> Now that I could compile again, I tried d.mon and it seems that there is
> no change in the output. That is, the write() call doesn't seem to be
> failing. Here's the output.

OK, I'm an idiot; I can't believe it took me this long to notice this. 
"c" changed from a "char" to an "int" when the "switch" was made into
a separate function (process_command()).

This doesn't affect anyone whose platform is little-endian (e.g. 
Intel), but on a big-endian platform it's sending a zero instead of
the COMMAND_ESC (127) which terminates the sequence. The client waits
forever for a COMMAND_ESC which never arrives.

Are you really the only person testing this on a big-endian platform? 
I suppose you must be.

I reckon that the attached patch (or the latest CVS version[1]) will
fix it.

[1] I've just checked a lot of other XDRIVER changes into CVS, so you
may wish to try just this first.

-- 
Glynn Clements <glynn.clements at virgin.net>

-------------- next part --------------
--- command.c~	Mon Apr 30 11:11:59 2001
+++ command.c	Wed May  2 08:46:00 2001
@@ -82,19 +82,20 @@
     ITEM *item;
     LIST *list;
     PAD *pad;
+    unsigned char ch;
 
     switch(c)
     {
     case BEGIN:
-	c = 0;
+	ch = 0;
 	for (index = -10; index < BEGIN_SYNC_COUNT; index++)
-	    SEND(&c, 1);
-	c = COMMAND_ESC;
-	SEND(&c, 1);
+	    SEND(&ch, 1);
+	ch = COMMAND_ESC;
+	SEND(&ch, 1);
 	break;
     case RESPOND:
 	Respond();
-	SEND(&c, 1);
+	SEND(&ch, 1);
 	break;
     case GET_NUM_COLORS:
 	Number_of_colors(&index);


More information about the grass-dev mailing list