madtty: close only valid file descriptors
commitccd9cadf4bbc634a0db900e277a1ac2d8e9aa585
authorRoss Mohn <rpmohn@waxandwane.org>
Sat, 27 Nov 2010 10:56:42 +0000 (27 11:56 +0100)
committerMarc Andre Tanner <mat@brain-dump.org>
Sat, 27 Nov 2010 10:56:42 +0000 (27 11:56 +0100)
treeddfc8e8e1a6904e3a38f0f232653a1ba525bb352
parentc9b9858db093523395444ade64769c7a491617b0
madtty: close only valid file descriptors

The for loop wasn't terminated upon the first bad file descriptor.
This resulted in a significant slow down on systems where
sysconf(_SC_OPEN_MAX) reports a huge value (like 2^16 on AIX).

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
madtty.c