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 702 invoked from network); 10 Jun 2021 08:12:30 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 10 Jun 2021 08:12:30 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1623312750; b=HemDiYXPsp1pjpomKh3+aar9wcOGs0BfD75upeKcKwIfU85XWeTsHaOCUlpDuIFS8y68diyYZ7 SQw3PBbv+qGeRKNszkTHCgFZp5uIm2BUOW2eMmP+cZwf/oXuljNisEIASATEWLLtgVZLcBkasw a6qNeEWV+07j+OzCXmhpm1h6wCWewZy8U/LL02rjA/0BnCAy6QCvwsXH22WMDS+Wy9gF9gv58s U1CKFprUYYh2d/61hYkuf0MV1FCCFiNm/GGSu6eBw0d5iJe6fCelRvoj/nvS8EX4eZCmnHgLot H1c/DnK04aNgw75RzMwttSsRKqYian2rlWp6hYZAxqk7Fw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1623312750; bh=butNkYD2+8Rf8STvpbADFfvWRuobhiLavG4kxm2ErX0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:DKIM-Signature; b=mcfWCBs72sVPvVx8nJ4h3Jd2EiSazXVUJFt94VtxpXvZEUcuZspISiymfnvq0Uk3NtRg6Lndgm B1Dm0nABB/5MftzuMhi6wZbMxcm7dSVy12uP+9I6kWZJ+3I93oVX3IrqY7jD0njQaCPrEB1kBu bn3+xf3aYs6O3o1ZfcpyLmZTS9aj9gKvshO4r91krKp75e0Q0QKtRtnPrfjrbVRv2Amafm9XIv 6IrMjn6vN8tAXCnHn3tLreMW94oamMVVzQlZUvYRnJtLgfJLCfqvOQaltGNYx89VYqC6V1He5J xBl+ek9ADB0C+u28qjrDBaZ26ebsxjSxr6aqH6VlT/JdQw==; 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-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID; bh=IhYot1isypoUYW5q9C0bkNFxsGRchhc12CwvC3Ha3IA=; b=m4ErCdl51eJzGW2wxOwtkuz0BN NHKQksdJuyZ/nqsQwki0arJmHF4pCjDVVBu+2RxL9unEEwW4dzWs2tlGLZc4nuQye9EGU3veZ8prJ eu6vzp+61qVzI1d9aZx2BMH4VE6tu3M0PH7mcNv0lc8sWMpTvLbq6adEf76BJS04Sq6GvwXfFxsdH 7nkMbTA++lsYs7T4MNJ489FcwkVHxziH9WKM0p5KWUePByZxjhqYMmmCnCj3zcP3rUbApOle+/3B8 UD762Ryg7pnO/Dk6UqPMKG+aHTTkQhPRykLaBzyPv/wfUgchKrS+Nxd4017tzLWHpcdEIsYgE5bjj ee4A19yg==; Received: from authenticated user by zero.zsh.org with local id 1lrFng-000KQ8-Fj; Thu, 10 Jun 2021 08:12:28 +0000 Authentication-Results: zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none Received: from joooj.vinc17.net ([155.133.131.76]:44048) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1lrFn8-000K60-EG; Thu, 10 Jun 2021 08:11:55 +0000 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by joooj.vinc17.net (Postfix) with ESMTPSA id 922A6F6; Thu, 10 Jun 2021 10:11:53 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id DD065C221CF; Thu, 10 Jun 2021 10:11:52 +0200 (CEST) Date: Thu, 10 Jun 2021 10:11:52 +0200 From: Vincent Lefevre To: zsh-workers@zsh.org Cc: Bart Schaefer Subject: Re: [BUG] builtin echo doesn't check write error Message-ID: <20210610081152.GA897070@zira.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org, Bart Schaefer References: <20210609140940.GA813383@zira.vinc17.org> <20210609181617.k5jbq3z37lt7ry5s@chazelas.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210609181617.k5jbq3z37lt7ry5s@chazelas.org> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/2.0.7+193 (0b2be236) vl-138295 (2021-06-07) X-Seq: 49050 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: On 2021-06-09 19:16:17 +0100, Stephane Chazelas wrote: > 2011 workers/29845 Peter notices the error is displayed in > (exec >&-; print) and adds a test case for it, but I'm not > sure he correctly identified why. I also find this disturbing: zira% (exec >&-; echo) zsh: write error: bad file descriptor zira% (exec >&-; echo >&-) zira% (or with "print" instad of "echo"). > POSIX does say that printf/echo should return with a non-zero > exit status upon error, and stderr be used for diagnostix > errors as usual. It's not clear to me if implementations are at > liberty to decide whether a write() error is considered an error > or not. Well, in almost all cases, e.g. when the close is not in the same command, and when this is not fd 1 (stdout), but other fd, such as in "echo foo 3>&- >&3", one gets an error. So this is already very inconsistent. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)