summaryrefslogtreecommitdiff
path: root/sh/runscript.sh.in
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2012-01-20 16:48:24 -0600
committerWilliam Hubbs <williamh@gentoo.org>2012-01-22 11:56:24 -0600
commit6e2fbf6a0fd04f2ba4afca8b7a2ef9af34ebf330 (patch)
treea37362ae0f913e361b1e4dfec9910d7073bfbb36 /sh/runscript.sh.in
parent2990e5a2e3ec06180ebe63448239e1cdad7878dd (diff)
downloadopenrc-6e2fbf6a0fd04f2ba4afca8b7a2ef9af34ebf330.tar.gz
openrc-6e2fbf6a0fd04f2ba4afca8b7a2ef9af34ebf330.tar.bz2
openrc-6e2fbf6a0fd04f2ba4afca8b7a2ef9af34ebf330.tar.xz
Make checks for writable directory posix compliant
Reported-by: Maxim Kammerer <mk@de.su> X-Gentoo-Bug: 398931 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=398931
Diffstat (limited to 'sh/runscript.sh.in')
-rw-r--r--sh/runscript.sh.in5
1 files changed, 5 insertions, 0 deletions
diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in
index 8e7fa69..3b91001 100644
--- a/sh/runscript.sh.in
+++ b/sh/runscript.sh.in
@@ -4,6 +4,11 @@
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
+dir_writable()
+{
+ mkdir "$1"/.test.$$ 2>/dev/null && rmdir "$1"/.test.$$
+}
+
sourcex()
{
if [ "$1" = "-e" ]; then