Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: sergos <sergos@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit 2/2] Fix io.close() error message.
Date: Thu, 14 Jul 2022 10:54:52 +0300	[thread overview]
Message-ID: <Ys/LzDiGnLXBzpW2@root> (raw)
In-Reply-To: <E3C3EE44-1FE7-49D9-9DE2-AA0B194747CC@tarantool.org>

Hi, Sergos!

Thanks for the review!

On 13.07.22, sergos wrote:
> Hi!
> 
> Thanks for the patch!
> 
> Just minor comments.

I've updated commit message to the following:

===================================================================
Fix io.close() error message.

Reported by François Perrad.

When an `io.close()` is called without arguments on an already closed
default output, the returned error message is `LJ_ERR_IOSTDCL`
("standard file is closed") instead of `LJ_ERR_IOCLFL` ("attempt to use
a closed file"). It is never a "real" standard file, because trying to
close a standard throws an error ("cannot close standard file"). Also,
this is inconsistent with PUC Lua.

This patch adds the corresponding check and a code branch for this
corner case.

Sergey Kaplun:
* added the description and the test for the problem

Part of tarantool/tarantool#7230
===================================================================

> 
> LGTM
> Sergos
> 
> 
> > On 18 May 2022, at 11:58, Sergey Kaplun <skaplun@tarantool.org> wrote:
> > 
> > From: Mike Pall <mike>
> > 
> > Reported by François Perrad.
> > 
> > When `io.close()` is called without arguments on already closed default
>       an                                          an 
> 
> > output the error message is `LJ_ERR_IOSTDCL` ("standard file is closed”)
>                        returned
> 
> > instead of `LJ_ERR_IOCLFL` ("attempt to use a closed file").  It is
> > never a "real" standard file, because trying to close a standard throws
> > an error ("cannot close standard file"). Also, this is inconsistent with
> > PUC Lua.
> > 
> > This patch adds the corresponding check and code branch for this corner
>                                              a
> 
> > case.
> > 
> > Sergey Kaplun:
> > * added the description and the test for the problem
> > ---
> > src/lib_io.c                                           | 10 ++++++++--
> > .../lj-735-io-close-on-closed-file.test.lua            |  5 +++--
> > 2 files changed, 11 insertions(+), 4 deletions(-)

<snipped>

> > 
> 

-- 
Best regards,
Sergey Kaplun

  reply	other threads:[~2022-07-14  7:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18  8:58 [Tarantool-patches] [PATCH luajit 0/2] Fix io.close() Sergey Kaplun via Tarantool-patches
2022-05-18  8:58 ` [Tarantool-patches] [PATCH luajit 1/2] " Sergey Kaplun via Tarantool-patches
2022-07-13 11:58   ` sergos via Tarantool-patches
2022-07-14  8:04     ` Sergey Kaplun via Tarantool-patches
2022-05-18  8:58 ` [Tarantool-patches] [PATCH luajit 2/2] Fix io.close() error message Sergey Kaplun via Tarantool-patches
2022-07-13 11:58   ` sergos via Tarantool-patches
2022-07-14  7:54     ` Sergey Kaplun via Tarantool-patches [this message]
2022-07-13 11:58 ` [Tarantool-patches] [PATCH luajit 0/2] Fix io.close() sergos via Tarantool-patches
2022-07-13 17:45   ` Sergey Kaplun via Tarantool-patches
2022-11-23  7:50 ` Igor Munkin via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Ys/LzDiGnLXBzpW2@root \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=sergos@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit 2/2] Fix io.close() error message.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox