From owner-freebsd-bugs@FreeBSD.ORG Sat Apr 26 10:30:01 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 338E7106566B for ; Sat, 26 Apr 2008 10:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 150558FC23 for ; Sat, 26 Apr 2008 10:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m3QAU0p1059475 for ; Sat, 26 Apr 2008 10:30:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m3QAU01A059472; Sat, 26 Apr 2008 10:30:00 GMT (envelope-from gnats) Resent-Date: Sat, 26 Apr 2008 10:30:00 GMT Resent-Message-Id: <200804261030.m3QAU01A059472@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Christoph Mallon Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C037106564A for ; 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 ; 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 ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/123109: Remove dead static variable from implementation of fdopen() X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2008 10:30:01 -0000 >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: