From patchwork Mon Oct 11 23:30:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D11626: dispatch: don't change error status if flushing stdio fails From: phabricator X-Patchwork-Id: 49950 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Mon, 11 Oct 2021 23:30:57 +0000 martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY If we already have a non-zero exit code, I don't think we should change it to 255 because we fail to flush stdio. This may not matter yet, but it will matter when I make a killed pager result in exit code 250 (it's currently 255). REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D11626 AFFECTED FILES mercurial/dispatch.py CHANGE DETAILS To: martinvonz, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -253,7 +253,7 @@ status = -1 ret = _flushstdio(req.ui, err) - if ret: + if ret and not status: status = ret return status