summaryrefslogtreecommitdiff
path: root/init.d
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2012-07-04 10:44:04 -0500
committerWilliam Hubbs <williamh@gentoo.org>2012-07-04 10:44:04 -0500
commit2967225819acc43adb3cbb62d558183e5f5a022e (patch)
tree1ca48643ae11bb2f91589abd05e2847074ce156a /init.d
parentudev-mount: remove selinux code (diff)
downloadudev-gentoo-scripts-2967225819acc43adb3cbb62d558183e5f5a022e.tar.gz
udev-gentoo-scripts-2967225819acc43adb3cbb62d558183e5f5a022e.tar.bz2
udev-gentoo-scripts-2967225819acc43adb3cbb62d558183e5f5a022e.zip
add caching to get_rundir
The get_rundir function should only run udevadm the first time it is called.
Diffstat (limited to 'init.d')
-rw-r--r--init.d/udev7
1 files changed, 6 insertions, 1 deletions
diff --git a/init.d/udev b/init.d/udev
index 9eb74bd..365f78a 100644
--- a/init.d/udev
+++ b/init.d/udev
@@ -67,9 +67,14 @@ check_kernel()
return 0
}
+_RC_GET_RUNDIR_CACHE=
get_rundir()
{
- echo $(udevadm info --run)
+ if [ -z "$_RC_GET_RUNDIR_CACHE" ]; then
+ _RC_GET_RUNDIR_CACHE="$(udevadm info --run)"
+ fi
+ echo "$_RC_GET_RUNDIR_CACHE"
+ return 0
}
cleanup()