scala/scala — pull request #224 by dcsobral (2012-02-22 18:44:36+00:00)
Title: Close file descriptor leak in sys.process. (SI-5439)

This closes most file descriptor leaks in sys.process through
the simple expedient of making sure every InputStream being read
by BasicIO is closed once there's nothing more to read.

A single file descriptor leak would remain for the OutputStream
(that is, that process stdin) of each Process, which is closed after the
InputStream being read to feed it is closed. Special care is taken
not to close the calling process stdin.

Fix an additional non-reported by where sending data to a process
that had already terminated would result in an exception being thrown.

File descriptors can still leak in some conditions that must be
handled by user code -- document it so.

Backports fix for SI-5439.