From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: esh-proc test failures Date: Tue, 23 Aug 2022 05:27:41 +0300 Message-ID: <837d2zae3m.fsf@gnu.org> References: <166036758418.2203.8730240669199078524@vcs2.savannah.gnu.org> <20220813051305.6667BC09BFE@vcs2.savannah.gnu.org> <87o7wmg0nx.fsf_-_@gnus.org> <30a7e3aa-ad52-325f-4fcd-528aade4a339@gmail.com> <838rng9kes.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8152"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, emacs-devel@gnu.org To: Jim Porter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 23 04:28:39 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oQJeg-0001z4-KU for ged-emacs-devel@m.gmane-mx.org; Tue, 23 Aug 2022 04:28:38 +0200 Original-Received: from localhost ([::1]:38620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQJef-0007cU-6I for ged-emacs-devel@m.gmane-mx.org; Mon, 22 Aug 2022 22:28:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQJdh-0006vE-In for emacs-devel@gnu.org; Mon, 22 Aug 2022 22:27:37 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47078) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQJdh-0000l6-8O; Mon, 22 Aug 2022 22:27:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=B68515cyJcno+q6VUw1sk0FKlQGfeIjzchGVVdW7X2A=; b=bfpsaPekErs2 IUhJJ6TeS6U4sTWUrCoSsWeOAxC04oqBGvtBe6Cyqda4NBzdQOm2Pf3R1b+l0diBOfcE6fRw4ugwq k0Ij/5vzb38/ujtDhHd5PBw6d04tEsVDV/oiVu0JaZr0d++2+Cp7fbNATwS1NOjlbJU2rUzW3lV9o uBxtRi4JbfSO3Spp+N7DQv322JCtY65ncYXTpG663GTj5vIoD/diP5MPnmodS/WsEy2Z8Qh9H5Y5Q lKVJKXPN+IBYayM0GTj6n+QMTy0QO96Hyh9sPLEi0tSJ7SJDR1WlHCs/O5ouv8pLVmdEImEgLwIl2 FM24VqZ+5IVf/d3WCmUpzw==; Original-Received: from [87.69.77.57] (port=2650 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQJdg-000854-DK; Mon, 22 Aug 2022 22:27:36 -0400 In-Reply-To: (message from Jim Porter on Mon, 22 Aug 2022 12:23:37 -0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:293826 Archived-At: > Cc: larsi@gnus.org, emacs-devel@gnu.org > From: Jim Porter > Date: Mon, 22 Aug 2022 12:23:37 -0700 > > >> + (eshell-pipe-broken > >> + ;; 141 is 128 + 13 (the numeric value of SIGPIPE). > >> + (setq eshell-last-command-status 141) > >> + nil) > > > > This is non-portable, I think on two counts: > > > > . the assumption that the exit code is the signal number left-shifted > > by N bits (btw, isn't N = 8, not 7?) > > . the assumption that SIGPIPE is signal 13 (does Posix mandate that?) > > > > What do we expect to happen here on MS-Windows and other non-Posix > > platforms, where both of the above assumptions are false? > > The only thing that really needs to happen here is that the signal is > caught so it doesn't bubble up past this point and break things. How do you accomplish that? On MS-Windows there's no SIGPIPE signal, for example. > The > command status could be anything really, and I'm pretty sure Eshell > doesn't even allow inspecting this value (yet), since it would only > occur for a non-last item in a pipeline. (In the future, Eshell could > offer something like $PIPESTATUS to examine this.) Not sure I understand completely what you are saying here, but AFAIR writing to a closed pipe on MS-Windows will cause EINVAL errno. > I could expand the comment to explain that this value is > somewhat-arbitrary and just designed to match GNU/Linux. Yes, please. > Alternately, if there's a way to inspect the system's conventions to > use here (e.g. getting the numeric value of SIGPIPE for the current > system), we could do that too. I might be able to help if I understand better what is needed here. Thanks.