* (UX_channel_close_all): Don't signal errors -- this is run when
authorChris Hanson <org/chris-hanson/cph>
Thu, 8 Nov 1990 11:08:07 +0000 (11:08 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 8 Nov 1990 11:08:07 +0000 (11:08 +0000)
  there is no runtime system to field them, and in any case they can
  be safely ignored here.

* (OS_channel_close_on_abort): New utility procedure.

v7/src/microcode/uxio.c

index 788f23b96fc5cee52eea1e8fe9e7bfb8282e3aeb..31b9f1d75d5b7d07a3edbf7838e90744ff86ca80 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxio.c,v 1.5 1990/08/16 19:22:41 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxio.c,v 1.6 1990/11/08 11:08:07 cph Exp $
 
 Copyright (c) 1990 Massachusetts Institute of Technology
 
@@ -44,7 +44,7 @@ DEFUN_VOID (UX_channel_close_all)
   Tchannel channel;
   for (channel = 0; (channel < OS_channel_table_size); channel += 1)
     if (CHANNEL_OPEN_P (channel))
-      OS_channel_close (channel);
+      OS_channel_close_noerror (channel);
 }
 
 void
@@ -88,7 +88,7 @@ DEFUN_VOID (channel_allocate)
       channel += 1;
     }
 }
-
+\f
 int
 DEFUN (OS_channel_open_p, (channel), Tchannel channel)
 {
@@ -112,6 +112,20 @@ DEFUN (OS_channel_close_noerror, (channel), Tchannel channel)
   UX_close (CHANNEL_DESCRIPTOR (channel));
   MARK_CHANNEL_CLOSED (channel);
 }
+
+static void
+DEFUN (channel_close_on_abort_1, (cp), PTR cp)
+{
+  OS_channel_close (* ((Tchannel *) cp));
+}
+
+void
+DEFUN (OS_channel_close_on_abort, (channel), Tchannel channel)
+{
+  Tchannel * cp = (dstack_alloc (sizeof (Tchannel)));
+  (*cp) = (channel);
+  transaction_record_action (tat_abort, channel_close_on_abort_1, cp);
+}
 \f
 enum channel_type
 DEFUN (OS_channel_type, (channel), Tchannel channel)