This is an archive of the discontinued Mercurial Phabricator instance.

chg: fallback to original hg if stdio fds are missing
ClosedPublic

Authored by quark on Sep 18 2020, 8:07 PM.

Details

Summary

If stdio fds are missing (ex. fd 0 is not present), chg might open
fds that take the numbers 0, and attachio would send the wrong fds
to the client, which might cause unwanted behaviors. Avoid that by
detecting the missing fds and falling back to the original hg.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

quark created this revision.Sep 18 2020, 8:07 PM
indygreg accepted this revision.Sep 22 2020, 10:10 PM
indygreg added a subscriber: indygreg.

This looks like a legit bug fix. And when I see patches like this, I wonder what circumstances led to its discovery :p

This revision is now accepted and ready to land.Sep 22 2020, 10:10 PM
This revision was automatically updated to reflect the committed changes.
quark added a comment.EditedSep 27 2020, 9:10 PM

This looks like a legit bug fix. And when I see patches like this, I wonder what circumstances led to its discovery :p

Context here. There was a similar issue in watchman. It seems this can be an easy "mistake" using the posix_spawn API.