Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Apr 2008 10:24:28 GMT
From:      Christoph Mallon <christoph.mallon@gmx.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/123109: Remove dead static variable from implementation of fdopen()
Message-ID:  <200804261024.m3QAOSNs023652@www.freebsd.org>
Resent-Message-ID: <200804261030.m3QAU01A059472@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         123109
>Category:       misc
>Synopsis:       Remove dead static variable from implementation of fdopen()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 26 10:30:00 UTC 2008
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200804261024.m3QAOSNs023652>