From 6cee32287cccdb512b2c6d42bc2e4fcaebcf6ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Tue, 8 Mar 2016 20:04:55 +0000 Subject: [PATCH] [INTERPRETER] * BUG: Now raise an error when a stream cannot be closed, instead of silently ignoring it. git-svn-id: svn://localhost/gambas/trunk@7622 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- main/gbx/gbx_stream.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main/gbx/gbx_stream.c b/main/gbx/gbx_stream.c index 90d3047e6..b5c1fcb53 100644 --- a/main/gbx/gbx_stream.c +++ b/main/gbx/gbx_stream.c @@ -291,8 +291,13 @@ void STREAM_close(STREAM *stream) stop_watching(stream, GB_WATCH_NONE); - if (stream->common.standard || !(*(stream->type->close))(stream)) - stream->type = NULL; + if (!stream->common.standard) + { + if ((*(stream->type->close))(stream)) + THROW_SYSTEM(errno, ""); + } + + stream->type = NULL; #if DEBUG_STREAM _nopen--;