* ports.c (scm_add_to_port_table): allocate in units of
authorGary Houston <ghouston@arglist.com>
Tue, 3 Mar 1998 10:11:13 +0000 (10:11 +0000)
committerGary Houston <ghouston@arglist.com>
Tue, 3 Mar 1998 10:11:13 +0000 (10:11 +0000)
struct scm_port_table *, not struct scm_port_table.
* posix.c (scm_close_pipe): remove the port from the port table
and mark as closed.
Thanks to Rob Engle for both fixes.

libguile/ChangeLog
libguile/ports.c
libguile/posix.c

index e579d17..1001051 100644 (file)
@@ -1,3 +1,11 @@
+Mon Mar  2 21:35:02 1998  Gary Houston  <ghouston@actrix.gen.nz>
+
+       * ports.c (scm_add_to_port_table): allocate in units of 
+       struct scm_port_table *, not struct scm_port_table.
+       * posix.c (scm_close_pipe): remove the port from the port table
+       and mark as closed.
+       Thanks to Rob Engle for both fixes.
+
 1998-02-06  Mikael Djurfeldt  <mdj@mdj.nada.kth.se>
 
        * iselect.h, iselect.c, coop.c, coop-threads.c, coop-threads.h,
index f90f34b..bbcad84 100644 (file)
@@ -246,8 +246,8 @@ scm_add_to_port_table (port)
     {
       scm_port_table = ((struct scm_port_table **)
                        realloc ((char *) scm_port_table,
-                                (long) (sizeof (struct scm_port_table)
-                                        * scm_port_table_room * 2)));
+                                (scm_sizet) (sizeof (struct scm_port_table *)
+                                             * scm_port_table_room * 2)));
       /* !!! error checking */
       scm_port_table_room *= 2;
     }
index 2307290..6ae76da 100644 (file)
@@ -988,6 +988,8 @@ scm_close_pipe (port)
              && SCM_OPENP (port), port, SCM_ARG1, s_close_pipe);
   SCM_DEFER_INTS;
   rv = pclose ((FILE *) SCM_STREAM (port));
+  scm_remove_from_port_table (port);
+  SCM_SETAND_CAR (port, ~SCM_OPN);
   if (rv == -1)
     scm_syserror (s_close_pipe);
   SCM_ALLOW_INTS;