+2000-11-13 Gary Houston <ghouston@arglist.com>
+
+ * fports.c: include gc.h.
+ (fport_flush, fport_close): silently ignore I/O errors when
+ closing a port during gc. it's better than aborting in scm_error.
+
+ * throw.c (scm_handle_by_message): remove obsolete comment.
+
2000-11-12 Gary Houston <ghouston@arglist.com>
* fports.c (scm_open_file): fix the 'b' option. Thanks
#include <fcntl.h>
#include "libguile/_scm.h"
#include "libguile/strings.h"
-
#include "libguile/validate.h"
+#include "libguile/gc.h"
+
#include "libguile/fports.h"
#ifdef HAVE_STRING_H
}
pt->write_pos = pt->write_buf + remaining;
}
- if (!terminating)
- scm_syserror ("fport_flush");
- else
+ if (terminating)
{
const char *msg = "Error: could not flush file-descriptor ";
char buf[11];
count = remaining;
}
+ else if (scm_gc_running_p)
+ {
+ /* silently ignore the error. scm_error would abort if we
+ called it now. */
+ count = remaining;
+ }
+ else
+ scm_syserror ("fport_flush");
}
ptr += count;
remaining -= count;
fport_flush (port);
SCM_SYSCALL (rv = close (fp->fdes));
if (rv == -1 && errno != EBADF)
- scm_syserror ("fport_close");
+ {
+ if (scm_gc_running_p)
+ /* silently ignore the error. scm_error would abort if we
+ called it now. */
+ ;
+ else
+ scm_syserror ("fport_close");
+ }
if (pt->read_buf == pt->putback_buf)
pt->read_buf = pt->saved_read_buf;
if (pt->read_buf != &pt->shortbuf)
}
handler_message (handler_data, tag, args);
- /* try to flush the error message first before the rest of the
- ports: if any throw error, it currently causes a bus
- exception. */
exit (2);
}