[GRASS5] Volunteer wanted for CELL driver color problem

Glynn Clements glynn.clements at virgin.net
Wed Apr 18 17:34:30 EDT 2001


Andreas Lange wrote:

> i watched this strange behaviour with my last cygwin/Windows build of
> the pre-stable code. IMHO it is not the "start" parameter, but d.mon
> start=CELL works once, but no longer after the CELL driver is stopped
> with d.mon stop=CELL. 
> I can restart the CELL driver only if i remove the
> $LOCATION/.tmp/$hostname/CELL socket file. I think for some reason the
> file/socket is not removed. 

Compare the code in src/display/devices/lib/SWITCHER.c:

    if (G_sock_exists(sockpath) && 
	(listenfd = G_sock_connect(sockpath)) != -1)
    {
	close (listenfd);
	G_fatal_error ("Monitor <%s> is already running", me);
    }

to that in src/display/devices/XDRIVER/XDRIVER24/SWITCHER.c:

    if (G_sock_exists(sockpath))
    {
        if ((listenfd = G_sock_connect(sockpath)) != -1)
        {
	    close (listenfd);
	    fprintf (stderr, "Monitor <%s> is already running\n", me);
            exit (EXIT_FAILURE);
        }
        if (unlink (sockpath) != 0)
        {
            fprintf (stderr, "Failed to remove stale socket file:\n"\
                    "\t%s\n", sockpath);
            exit (EXIT_FAILURE);
        }
    }

Someone thought to remove the socket if it exists but is unused; but
only for the XDRIVER case.

I've been looking through some of the files in src/display/devices
today, and it's clear that the whole thing needs a spring clean. A lot
of code is (more or less) duplicated when it ought to be shared, and
changes only seem to get put into one or other of the different
versions.

Rather than just copying the fixes around between the versions, I'm
going to start moving common code out of the individual drivers and
back into src/display/devices/lib where it belongs.

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

---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list