diff --git a/Makefile b/Makefile index 244d1e48cd..20e5dd675a 100644 --- a/Makefile +++ b/Makefile @@ -239,6 +239,8 @@ UVTEST += simple/test-child-process-buffering UVTEST += simple/test-child-process-exec-cwd UVTEST += simple/test-child-process-cwd UVTEST += simple/test-child-process-env +UVTEST += simple/test-child-process-stdin +UVTEST += simple/test-child-process-ipc test-uv: all diff --git a/lib/net_uv.js b/lib/net_uv.js index a8c339c248..193646e41a 100644 --- a/lib/net_uv.js +++ b/lib/net_uv.js @@ -191,13 +191,14 @@ function afterShutdown(status, handle, req) { var self = handle.socket; assert.ok(self._flags & FLAG_SHUTDOWN); + assert.ok(!self.writable); // callback may come after call to destroy. if (self.destroyed) { return; } - if (self._flags & FLAG_GOT_EOF) { + if (self._flags & FLAG_GOT_EOF || !self.readable) { self.destroy(); } else { }