rc.d/ldconfig change
M. Warner Losh
imp at bsdimp.com
Fri Aug 26 21:22:23 GMT 2005
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
More information about the freebsd-hackers
mailing list