getpid and xmaxima



hello,

it has been reported that in some circumstances xmaxima kills off
everything when it closes.
http://sourceforge.net/tracker/index.php?func=detail&aid=1276259&group_id=4933&atid=104933
there is also a bug report in the fedora bug tracker:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=168451

there was another bug of the same kind some time ago,
but from what i can tell this is a different bug.

the problem seems to hinge on the return value for getpid in src/server.lisp:
with clisp, it is possible for the return value to be -1,
which kill interprets as "kill everything".

(there does not appear to be a safe default value for the pid;
positive, negative, and 0 values all mean something.)

it seems there are at least 3 ways to approach this:
(1) have getpid-from-environment throw something or return
something that is not an integer when the pid cannot be determined.
(2) have xmaxima check the pid value, and refuse to execute
kill if it is something other than a positive integer.
(3) expunge the code which can return -1. this may imply a compile-time
failure if there is no function to determine the pid.

any comments on this point are invited.
for the record, i'm in favor of (3).

all the best & hope this helps,
robert dodier