From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 4AFEF6ECE3; Thu, 14 Jul 2022 10:57:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4AFEF6ECE3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1657785436; bh=O6+BqcrZiCJevQeGccqgiLjaaohUWN4U/SnI9HP2QoE=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=hG2TGNistZElEnx+gJnh637r0bIxD1BuELtm/0THt9/VtWP10ATmVCbiV7f7O1bif OFiJGsz/SkGAhjDzxF4UXe5tpfcgFMc4zDy1hOu7OPirLgZdnWrrG+nelGz63WhHlj jlrTBIvViuoDvueqhpVkKbBTLXCkQ0YzUtG9GDOo= Received: from smtp43.i.mail.ru (smtp43.i.mail.ru [94.100.177.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 2D1436ECE3 for ; Thu, 14 Jul 2022 10:57:14 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2D1436ECE3 Received: by smtp43.i.mail.ru with esmtpa (envelope-from ) id 1oBtij-0005f0-7L; Thu, 14 Jul 2022 10:57:13 +0300 Date: Thu, 14 Jul 2022 10:54:52 +0300 To: sergos Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9E1E7861EDEC0DEA642A52A3D70DB4D8C9D750E388E4A7DAE00894C459B0CD1B9DEBDC7F9637FED31692907AC8452B9FFEB78FBC389580AC7BDDA091DB0BAA87C X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE716FAD50E497B9C14EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006376EC5B14D896A2D978638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D80B42F8F84AAE7781358A44141FF8C48B117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCDCBA8CBAA3833548A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18BDFBBEFFF4125B51D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE38D4DC57D478E6889935A1E27F592749D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE3672DC5A730DF09D2AD7EC71F1DB88427C4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637A7EFCB0EB5ACB161EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-8FC586DF: 6EFBBC1D9D64D975 X-C1DE0DAB: 9604B64F49C60606AD91A466A1DEF99B296C473AB1E142185AC9E3593CE4B31AB1881A6453793CE9274300E5CE05BD4401A9E91200F654B01A22A53B1D49F786EEDD2DF4914E7A12D750FDB433BB820BE28FFE93BFC593269C2B6934AE262D3EE7EAB7254005DCED8DA55E71E02F9FC08E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3480665FBD8F49180C29E0E8924A2AA167253D47DFEEBFAB493BF1CA9224494DD2421D1376D08EED781D7E09C32AA3244C9008725416E6108F1DB34FC4591838D324AF4FAF06DA24FDFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojpV6+aF9js38LIXR3wnHrQQ== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A7694FAC3D9BD29163BF65DC58E189528ABA825871508D9F3970DEDBA653FF35249392D99EB8CC7091A70E183A470755BFD208F19895AA18418972D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 2/2] Fix io.close() error message. X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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 wrote: > > > > From: Mike Pall > > > > 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(-) > > > -- Best regards, Sergey Kaplun