Patchwork D11626: dispatch: don't change error status if flushing stdio fails

login
register
mail settings
Submitter phabricator
Date Oct. 11, 2021, 11:30 p.m.
Message ID <differential-rev-PHID-DREV-ptx5xc7eakiarcthrxaf-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49950/
State Superseded
Headers show

Comments

phabricator - Oct. 11, 2021, 11:30 p.m.
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

Patch

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