Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
console: avoid adding infinite error listeners
If the console destination is a unix pipe (net.Socket), write() is async. If the destination is broken, we are adding an 'error' event listener to avoid a process crash. This PR makes sure that we are adding that listener only once. Fixes: #16767 PR-URL: #16770 Fixes: #16767 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
- Loading branch information