[gambit-list] Take 2 : __cleanup() problem (OS X 10.6.6 / Gambit-C 4.6.0)
David Dreisigmeyer
dwdreisigmeyer at gmail.com
Sat Jan 15 12:26:32 EST 2011
My system again: OS X 10.6.6 and Gambit-C 4.6.0 from git.
I'm not getting that. The modified code is below. Here's what I get:
$ ./gambit_tester > hold
and hold looks like:
setup done
Gambit-C : (+ 1 2)
3
Gambit-C result : 3
I even tried modifying ___cleanup:
___EXP_FUNC(void,___cleanup) ___PVOID
{
/*
* Only do cleanup once after successful setup.
*/
printf ("setup_state : %i \n" , setup_state);
fflush (stdout);
sleep(30);
if (setup_state != 1)
return;
setup_state = 2;
___cleanup_mem ();
___cleanup_os ();
}
and it doesn't print or sleep.
--------------------------------------------------------
** Modified os_io.c:
/*
#ifdef USE_POSIX
if (close_no_EINTR (d->fd) < 0)
return err_code_from_errno ();
#endif
*/
#ifdef USE_POSIX
if (d->fd > 2 && close_no_EINTR (d->fd) < 0)
return err_code_from_errno ();
#endif
#ifdef USE_WIN32
if (!CloseHandle (d->h))
return err_code_from_GetLastError ();
#endif
}
else if (is_not_closed & direction & ___DIRECTION_RD)
d->base.base.read_stage = ___STAGE_CLOSED;
else if (is_not_closed & direction & ___DIRECTION_WR)
d->base.base.write_stage = ___STAGE_CLOSED;
return ___FIX(___NO_ERR);
}
--------------------------------------------------------
** Modified ___device_tty_cleanup (tried commenting out #ifdef
USE_POSIX ... #endif also:
___HIDDEN ___SCMOBJ ___device_tty_cleanup
___P((___device_tty *self),
(self)
___device_tty *self;)
{
___device_tty *d = self;
___SCMOBJ e;
/*
#ifdef USE_LINEEDITOR
lineeditor_cleanup (d);
#endif
if (d->stage >= TTY_STAGE_MODE_NOT_SAVED)
{
if (d->stage >= TTY_STAGE_MODE_NOT_SET)
{
if ((e = ___device_tty_mode_restore (d, 1)) != ___FIX(___NO_ERR))
return e;
}
*/
#ifdef USE_POSIX
if (close (d->fd) < 0)
return err_code_from_errno ();
#endif
/*
#ifdef USE_WIN32
if (!CloseHandle (d->hin))
return err_code_from_GetLastError ();
if (!CloseHandle (d->hout))
return err_code_from_GetLastError ();
#endif
}
*/
return ___FIX(___NO_ERR);
}
More information about the Gambit-list
mailing list