From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 26 21:22:23 2005 Return-Path: X-Original-To: hackers@FreeBSD.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4797416A41F for ; Fri, 26 Aug 2005 21:22:23 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.village.org (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id BFED043D45 for ; Fri, 26 Aug 2005 21:22:22 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1]) by harmony.village.org (8.13.3/8.13.3) with ESMTP id j7QLKZh1006434 for ; Fri, 26 Aug 2005 15:20:35 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 26 Aug 2005 15:20:41 -0600 (MDT) Message-Id: <20050826.152041.74686851.imp@bsdimp.com> To: hackers@FreeBSD.org From: "M. Warner Losh" X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.village.org [127.0.0.1]); Fri, 26 Aug 2005 15:20:35 -0600 (MDT) Cc: Subject: rc.d/ldconfig change X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2005 21:22:23 -0000 In the embedded system that I'm working on, I've discovered a minor problem with the /etc/rc.d/ldconfig script. It assumes that you have a /usr/lib/aout directory. While this is true by default, I believe it would be better if the ldconfig script didn't assume this and actually tested for its existance before trying to run ldconfig -aout on it. This would allow those users who do not want any aout support in their system to eliminate it completely w/o it generating warnings. To that end, I've worked up this patch that I'd like to commit and MFC after it has settled a bit. What do people here think? Since the patch is short, I'm including it inline. Warner Index: ldconfig =================================================================== RCS file: /cache/ncvs/src/etc/rc.d/ldconfig,v retrieving revision 1.14 diff -u -r1.14 ldconfig --- ldconfig 16 Jan 2005 08:34:30 -0000 1.14 +++ ldconfig 26 Aug 2005 21:17:13 -0000 @@ -35,14 +35,16 @@ i386) # Default the a.out ldconfig path. : ${ldconfig_paths_aout=${ldconfig_paths}} - _LDC=/usr/lib/aout - for i in ${ldconfig_paths_aout} /etc/ld.so.conf; do + _LDC= + for i in /usr/lib/aout ${ldconfig_paths_aout} /etc/ld.so.conf; do if [ -r "${i}" ]; then _LDC="${_LDC} ${i}" fi done - echo 'a.out ldconfig path:' ${_LDC} - ${ldconfig} -aout ${_ins} ${_LDC} + if [ -n ${_LDC} ]; then + echo 'a.out ldconfig path:' ${_LDC} + ${ldconfig} -aout ${_ins} ${_LDC} + fi ;; esac fi