summaryrefslogtreecommitdiffstats
path: root/bin/csh/misc.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1996-09-28 14:32:01 +0000
committerbde <bde@FreeBSD.org>1996-09-28 14:32:01 +0000
commit45b84eb11ac4f02693b5455fa1183313a65797ec (patch)
tree469d951ac9c12a8cc288e5fe3fd3c18154f705e9 /bin/csh/misc.c
parent8d0e25e3358cde4a2d2e6a06f7a5e496e38a2d75 (diff)
downloadFreeBSD-src-45b84eb11ac4f02693b5455fa1183313a65797ec.zip
FreeBSD-src-45b84eb11ac4f02693b5455fa1183313a65797ec.tar.gz
Close files up to getdtablesize() instead of up to NOFILE.
csh was one of the 3 programs in /usr/src that (mis)used NOFILE.
Diffstat (limited to 'bin/csh/misc.c')
-rw-r--r--bin/csh/misc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/csh/misc.c b/bin/csh/misc.c
index 79d2f90..a060d07 100644
--- a/bin/csh/misc.c
+++ b/bin/csh/misc.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: misc.c,v 1.2 1994/09/24 02:54:10 davidg Exp $
*/
#ifndef lint
@@ -252,9 +252,9 @@ lastchr(cp)
void
closem()
{
- register int f;
+ register int f, flimit;
- for (f = 0; f < NOFILE; f++)
+ for (f = 0, flimit = getdtablesize(); f < flimit; f++)
if (f != SHIN && f != SHOUT && f != SHERR && f != OLDSTD &&
f != FSHTTY)
(void) close(f);
OpenPOWER on IntegriCloud