From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21422 invoked from network); 9 Jun 2021 15:41:17 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 9 Jun 2021 15:41:17 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1623253277; b=KKxnc/+Or7elGO4c+EzlX3dI6bgwLKEQzwePs1UwzpoXBmArc6IhSF21yn6og/bS15WueaCSS7 OgWgBB5yQPMPyaNVrcwifjgjyE1Aem7RYIAptxKfMwAlXNTeHJg9QWPcapoQLO+fNUEuJ/iDuq xqxC9hVT/2yazkPLBnA5mNMaDR3jXh5O5cZMqA+hsFTIsnx23rxLpLkxi7ij5kD8qzpMa5hgoA Uf7SKY3wral5T+c/evfJ2tRdioi2aN7MCxRLV+LnYiXAtjNhhE0uGuBKd90wmi6r1eBjlccxGG NF+VFryiYVBmRcg2YIW5/LzUDdSpgJdEYjWsuXN752YZNw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (relay9-d.mail.gandi.net) smtp.remote-ip=217.70.183.199; dmarc=none header.from=chazelas.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1623253277; bh=foujlCdhWegntsROkqWc/z6fNwsEuooX4kpmCt0T4Us=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:From:Date:DKIM-Signature; b=zO2PBfpYmB21dX7jZ/SfvPPlGcURV731pxFyL7PE6nd2n+VCnQv3Ne5xzJ2H9Wfs0yxaqtGvj4 cQOVDO6TqCa9fh2e/QNDXKAU8Qxv8RpHcqUSxPH+WXCR89mhQiGmHa3fxLJLyxT9hM9By806A/ ofXIdYKTxus2j5+eU7PWtSNeEDJT7nMjox0MPUkg+f8Ju1sGf7+D+SgiabFpdYIJnu7w7fCAjn wDMqCx5jt64c99PJdUxlLKVAqASZB5hPCgZjmspiH2jdKTjwvK96nYDtR2sWsxKkdrfHeaTyyv 21XmnSWeMEOOamygglG149DKLAe4u2UaUVkU7BoiVx/fUQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:To:From:Date:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=YR5lXn1zlrbLyOSrNl/No1Xe5RRO7awpCQZH9zImsJg=; b=xZcLxSj20gl3Ju9Szitnv0+tAC kClNQgep6rrtpc/EzZJsfZ6l2Y5QIMCp4L92lk5/abDdT+EjO+tcD9c7Xq/vhz/NgbHYf2f5JfWbV 7aPYInO+dLh3jvIn09NSozLsd+Y5j761M+4i9K4GAKHZh74dlF8ICF/XrAeWyLMhbuNJnJHtKSGO4 QXNiafryk5NnpO0rv4nCsYq8S5hbHr8iBAsQ6hhmxr/TbLsY+jVygtM1qIBaqmoaaZRfO9yIk2qPi XYPAS0ekYSkvbhR/uZNonKIz82wco9ic+PhnOzqItQMwJkfquCVTtANzg17zc/WjH8+oEyNAx5owb 7TQZr0LA==; Received: from authenticated user by zero.zsh.org with local id 1lr0KI-0002X8-9H; Wed, 09 Jun 2021 15:41:06 +0000 Authentication-Results: zsh.org; iprev=pass (relay9-d.mail.gandi.net) smtp.remote-ip=217.70.183.199; dmarc=none header.from=chazelas.org; arc=none Received: from relay9-d.mail.gandi.net ([217.70.183.199]:50905) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1lr0K4-0002EF-4Z; Wed, 09 Jun 2021 15:40:52 +0000 Received: (Authenticated sender: stephane@chazelas.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 65F71FF810 for ; Wed, 9 Jun 2021 15:40:50 +0000 (UTC) Date: Wed, 9 Jun 2021 16:40:50 +0100 From: Stephane Chazelas To: zsh-workers@zsh.org Subject: Re: [BUG] builtin echo doesn't check write error Message-ID: <20210609154050.fwnzosv2qecno3kb@chazelas.org> Mail-Followup-To: zsh-workers@zsh.org References: <20210609140940.GA813383@zira.vinc17.org> <20210609141730.GA813881@zira.vinc17.org> <20210609153319.7h5v27vlahutfvpe@chazelas.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210609153319.7h5v27vlahutfvpe@chazelas.org> X-Seq: 49042 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: 2021-06-09 16:33:19 +0100, Stephane Chazelas: > 2021-06-09 16:17:30 +0200, Vincent Lefevre: > > On 2021-06-09 16:09:40 +0200, Vincent Lefevre wrote: > > > With zsh 5.8, the builtin echo doesn't check write error. > > > > And that's also the case for "print", "printf" and maybe others. > [...] > > It looks as if EBADF is treated specially on purpose. [...] See: https://www.zsh.org/mla/workers/2002/msg00158.html A04redirect.ztst still has: print foo >&- 0:'>&-' redirection (exec >&- print foo) 0:'>&-' with attempt to use closed fd *?\(eval\):2: write error:* That is "print" with stdout explicitely closed meant to return success and report no error message, but "print foo" without explicit closing outputs an error (but exit status still 0). So it seems to work as intended, though I'm not sure what the rationale is for that intended behaviour. -- Stephane