summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Houston <ghouston@arglist.com>1998-03-03 10:11:13 +0000
committerGary Houston <ghouston@arglist.com>1998-03-03 10:11:13 +0000
commit67fe060ed5df21bd3435a263d5179d042e521f7b (patch)
tree2f6bf7b17760cdadaa17f2a0f87d126be8823c17
parent186d31e78c909969758a6a5b38318bdfad944bc8 (diff)
downloadguile-67fe060ed5df21bd3435a263d5179d042e521f7b.tar.gz
* 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.
-rw-r--r--libguile/ChangeLog8
-rw-r--r--libguile/ports.c4
-rw-r--r--libguile/posix.c2
3 files changed, 12 insertions, 2 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog
index e579d17e0..10010513e 100644
--- a/libguile/ChangeLog
+++ b/libguile/ChangeLog
@@ -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,
diff --git a/libguile/ports.c b/libguile/ports.c
index f90f34b00..bbcad8428 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -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;
}
diff --git a/libguile/posix.c b/libguile/posix.c
index 2307290e7..6ae76daaa 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -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;