Fix EPIPE workaround for Darwin #2791

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@mfncooper
npm member

The current workaround for the EPIPE error on Darwin, when running . <(npm completion), does not work because the errno that comes back from Node is actually a string, rather than the numeric error code it's being compared against. This patch fixes that test.

With the test fixed, there's another error, because we call our callback twice. The first time is when we get called back from write(), and the second when we process the EPIPE error. Thus the patch includes code to ensure that we only call our callback once.

@isaacs
npm member

Landed on 5effe86. Thanks!

@isaacs isaacs closed this Nov 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment