Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Aug 2005 15:20:41 -0600 (MDT)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        hackers@FreeBSD.org
Subject:   rc.d/ldconfig change
Message-ID:  <20050826.152041.74686851.imp@bsdimp.com>

next in thread | raw e-mail | index | archive | help
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



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