summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--byterun/io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/byterun/io.c b/byterun/io.c
index 4148dfb89..ba3010d4b 100644
--- a/byterun/io.c
+++ b/byterun/io.c
@@ -51,7 +51,7 @@ static void finalize_channel(vchan)
value vchan;
{
struct channel * chan = (struct channel *) vchan;
- close(chan->fd);
+ if (chan->fd != -1) close(chan->fd);
}
struct channel * open_descr(fd)