From d5bf2d0a38cdeacdd654d8768fa925ad8d72933d Mon Sep 17 00:00:00 2001 From: deraadt Date: Fri, 10 May 1996 12:58:04 +0000 Subject: [PATCH] torek fix to close old descriptor silently --- lib/libc/stdio/freopen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/stdio/freopen.c b/lib/libc/stdio/freopen.c index 85d3ed2646f..e5e0b53e84b 100644 --- a/lib/libc/stdio/freopen.c +++ b/lib/libc/stdio/freopen.c @@ -1,4 +1,4 @@ -/* $NetBSD: freopen.c,v 1.4 1995/02/02 02:09:36 jtc Exp $ */ +/* $NetBSD: freopen.c,v 1.5 1996/05/04 19:25:19 mycroft Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -40,7 +40,7 @@ #if 0 static char sccsid[] = "@(#)freopen.c 8.1 (Berkeley) 6/4/93"; #endif -static char rcsid[] = "$NetBSD: freopen.c,v 1.4 1995/02/02 02:09:36 jtc Exp $"; +static char rcsid[] = "$NetBSD: freopen.c,v 1.5 1996/05/04 19:25:19 mycroft Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -114,7 +114,7 @@ freopen(file, mode, fp) * keep fp->_base: it may be the wrong size. This loses the effect * of any setbuffer calls, but stdio has always done this before. */ - if (isopen) + if (isopen && f != wantfd) (void) (*fp->_close)(fp->_cookie); if (fp->_flags & __SMBF) free((char *)fp->_bf._base); -- 2.20.1