[gambit-list] Take 2 : __cleanup() problem (OS X 10.6.6 / Gambit-C 4.6.0)
Marc Feeley
feeley at iro.umontreal.ca
Sat Jan 15 13:52:52 EST 2011
On 2011-01-15, at 12:26 PM, David Dreisigmeyer wrote:
> #ifdef USE_POSIX
> if (close (d->fd) < 0)
> return err_code_from_errno ();
> #endif
This (in os_tty.c) must be commented out too, otherwise the controlling terminal will be closed when you get to the printf("cleanup done") which follows the call to ___cleanup. Please try that.
I will be changing the Gambit runtime so that file descriptors which were already open when ___setup was called, will not be closed when ___cleanup is called. The problem with the controlling terminal is that it is obtained by calling open("/dev/tty",...) so in principle it should be the Gambit runtime's responsibility to close it.
I think we are losing track of the original problem. The problem here is related to closing the file descriptors at the wrong time, so that subsequent output to the terminal (and stdout) do not occur. The original problem that you had was that Python was exiting with a non-zero process status. I don't think we are closer to a solution for that.
Marc
More information about the Gambit-list
mailing list