summaryrefslogtreecommitdiff
path: root/libmu_scm
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2002-04-19 12:32:52 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2002-04-19 12:32:52 +0000
commit04f77458e16fb43a37ecd70626034ec3d0776e5d (patch)
treea945e9c4de242243c360fb4c7bd644ea09e7bc00 /libmu_scm
parentec669433366ebf6957f0f9a6f94405cefe57052f (diff)
downloadmailutils-04f77458e16fb43a37ecd70626034ec3d0776e5d.tar.gz
mailutils-04f77458e16fb43a37ecd70626034ec3d0776e5d.tar.bz2
(mu_port_mark): Do nothing if the port is not in open state.
Diffstat (limited to 'libmu_scm')
-rw-r--r--libmu_scm/mu_port.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libmu_scm/mu_port.c b/libmu_scm/mu_port.c
index a34e81785..7a0877e3d 100644
--- a/libmu_scm/mu_port.c
+++ b/libmu_scm/mu_port.c
@@ -100,8 +100,12 @@ mu_port_make_from_stream (SCM msg, stream_t stream, long mode)
static SCM
mu_port_mark (SCM port)
{
- struct mu_port *mp = MU_PORT (port);
- return mp->msg;
+ if (SCM_CELL_WORD_0 (port) & SCM_OPN)
+ {
+ struct mu_port *mp = MU_PORT (port);
+ return mp->msg;
+ }
+ return SCM_BOOL_F;
}
static void
@@ -129,6 +133,9 @@ mu_port_close (SCM port)
scm_port *pt = SCM_PTAB_ENTRY (port);
mu_port_flush (port);
+ stream_close (mp->stream);
+ SCM_SETSTREAM (port, NULL);
+
if (pt->read_buf != &pt->shortbuf)
free (pt->read_buf);
if (pt->write_buf != &pt->shortbuf)

Return to:

Send suggestions and report system problems to the System administrator.