From owner-svn-src-stable-7@FreeBSD.ORG Fri Apr 8 06:55:26 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03637106566C; Fri, 8 Apr 2011 06:55:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E76518FC14; Fri, 8 Apr 2011 06:55:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p386tPLE067033; Fri, 8 Apr 2011 06:55:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p386tPmr067031; Fri, 8 Apr 2011 06:55:25 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201104080655.p386tPmr067031@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Apr 2011 06:55:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220441 - stable/7/libexec/rtld-elf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Apr 2011 06:55:26 -0000 Author: avg Date: Fri Apr 8 06:55:25 2011 New Revision: 220441 URL: http://svn.freebsd.org/changeset/base/220441 Log: MFC r220004: rtld: eliminate double call to close(2) that may occur in load_object Modified: stable/7/libexec/rtld-elf/rtld.c Directory Properties: stable/7/libexec/rtld-elf/ (props changed) Modified: stable/7/libexec/rtld-elf/rtld.c ============================================================================== --- stable/7/libexec/rtld-elf/rtld.c Fri Apr 8 06:50:26 2011 (r220440) +++ stable/7/libexec/rtld-elf/rtld.c Fri Apr 8 06:55:25 2011 (r220441) @@ -1474,12 +1474,9 @@ load_object(const char *name, const Obj_ free(path); return NULL; } - for (obj = obj_list->next; obj != NULL; obj = obj->next) { - if (obj->ino == sb.st_ino && obj->dev == sb.st_dev) { - close(fd); + for (obj = obj_list->next; obj != NULL; obj = obj->next) + if (obj->ino == sb.st_ino && obj->dev == sb.st_dev) break; - } - } if (obj != NULL) { object_add_name(obj, name); free(path);