According to Geoff Hutchison:
> Aha. I figured out the bug with closing and opening pipes (you have to do
> it in the right order)!
>
> Attached is a patch to the 121000 snapshot to get ExternalTransport and
> ExternalParser to work correctly.
>
> Please test the snapshot (pref. with patch) and push on it. I will try
> fix up bugs ASAP so we can try to get 3.2.0b3 out this week. (fingers
> crossed)
Yes, the order is extremely important. the dup() call will use the
first available fd slot, so if you close 0, 2 and 1, as you were doing,
the dup will return 0, not 1. Big question, though: why are you closing
stdin and stderr at all??? If you close stdin, you should probably
reopen is with /dev/null or something inoccuous like that, or perhaps
better yet the input file itself. However, a properly written external
parser or converter should simply leave stdin alone. In any case,
you most definitely DO NOT want to close stderr, or you lose any error
output from the external parser or converter, which would be disatrous
in terms of trying to debug its operation. The popen didn't do this,
so why are we doing it now?
By the way, the customary practise when fork() fails is to sleep a few
seconds and try again, up to a certain maximum (2-4 times), or just give
up on starting the process. In any case, you don't want to make htdig
abort at this point just because it can't start the external parser,
do you?
--
Gilles R. Detillieux E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre WWW: http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba Phone: (204)789-3766
Winnipeg, MB R3E 3J7 (Canada) Fax: (204)789-3930
------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
[EMAIL PROTECTED]
You will receive a message to confirm this.