From nobody@FreeBSD.org  Sat Apr 26 10:24:59 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4C037106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 26 Apr 2008 10:24:59 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 3FAA68FC21
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 26 Apr 2008 10:24:59 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m3QAOSrL023653
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 26 Apr 2008 10:24:28 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m3QAOSNs023652;
	Sat, 26 Apr 2008 10:24:28 GMT
	(envelope-from nobody)
Message-Id: <200804261024.m3QAOSNs023652@www.freebsd.org>
Date: Sat, 26 Apr 2008 10:24:28 GMT
From: Christoph Mallon <christoph.mallon@gmx.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Remove dead static variable from implementation of fdopen()
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         123109
>Category:       kern
>Synopsis:       [libc] Remove dead static variable from implementation of fdopen()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    antoine
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 26 10:30:00 UTC 2008
>Closed-Date:    Mon Jul 28 19:48:44 UTC 2008
>Last-Modified:  Mon Jul 28 19:48:44 UTC 2008
>Originator:     Christoph Mallon
>Release:        n/a
>Organization:
>Environment:
n/a
>Description:
The implementation of fdopen() contains the static variable nofile, which only gets tested to assign to it, but is not used otherwise. This variable is dead since revision 1.1 of this file.
>How-To-Repeat:

>Fix:
Apply the patch, which removes this static variable.

Patch attached with submission follows:

Index: fdopen.c
===================================================================
RCS file: /home/ncvs/src/lib/libc/stdio/fdopen.c,v
retrieving revision 1.10
diff -u -r1.10 fdopen.c
--- fdopen.c	27 Feb 2008 21:25:19 -0000	1.10
+++ fdopen.c	26 Apr 2008 10:11:56 -0000
@@ -52,11 +52,7 @@
 	const char *mode;
 {
 	FILE *fp;
-	static int nofile;
 	int flags, oflags, fdflags, tmp;
-
-	if (nofile == 0)
-		nofile = getdtablesize();
 
 	/*
 	 * File descriptors are a full int, but _file is only a short.


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->antoine 
Responsible-Changed-By: antoine 
Responsible-Changed-When: Sat Apr 26 17:55:48 UTC 2008 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=123109 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/123109: commit references a PR
Date: Sat, 10 May 2008 18:39:28 +0000 (UTC)

 antoine     2008-05-10 18:39:20 UTC
 
   FreeBSD src repository
 
   Modified files:
     lib/libc/stdio       fdopen.c 
   Log:
   Remove useless call to getdtablesize(2) in fdopen(3) and its useless
   variable nofile.
   
   PR:             123109
   Submitted by:   Christoph Mallon
   Approved by:    rwatson (mentor)
   MFC after:      1 month
   
   Revision  Changes    Path
   1.11      +0 -4      src/lib/libc/stdio/fdopen.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: antoine 
State-Changed-When: Sat May 10 18:51:57 UTC 2008 
State-Changed-Why:  
Patched in HEAD. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=123109 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/123109: commit references a PR
Date: Mon, 28 Jul 2008 19:35:55 +0000 (UTC)

 antoine     2008-07-28 19:35:26 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     lib/libc/stdio       fdopen.c 
   Log:
   SVN rev 180933 on 2008-07-28 19:35:26Z by antoine
   
   MFC r178921 to stable/7:
     Remove useless call to getdtablesize(2) in fdopen(3) and its useless
     variable nofile.
   
     PR:             123109
     Submitted by:   Christoph Mallon
     Approved by:    rwatson (mentor)
     MFC after:      1 month
   
   Revision  Changes    Path
   1.8.2.2   +0 -4      src/lib/libc/stdio/fdopen.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/123109: commit references a PR
Date: Mon, 28 Jul 2008 19:37:55 +0000 (UTC)

 antoine     2008-07-28 19:37:26 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_6)
     lib/libc/stdio       fdopen.c 
   Log:
   SVN rev 180934 on 2008-07-28 19:37:26Z by antoine
   
   MFC r178921 to stable/6:
     Remove useless call to getdtablesize(2) in fdopen(3) and its useless
     variable nofile.
   
     PR:             123109
     Submitted by:   Christoph Mallon
     Approved by:    rwatson (mentor)
     MFC after:      1 month
   
   Revision  Changes    Path
   1.7.14.2  +0 -4      src/lib/libc/stdio/fdopen.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: antoine 
State-Changed-When: Mon Jul 28 19:47:56 UTC 2008 
State-Changed-Why:  
Close: fix committed in head, releng_6 and releng_7. 
Thanks for the report! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=123109 
>Unformatted:
