misc/123109: Remove dead static variable from implementation of
fdopen()
Christoph Mallon
christoph.mallon at gmx.de
Sat Apr 26 10:30:01 UTC 2008
>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:
More information about the freebsd-bugs
mailing list