commit:     23d806ca24845261fd89104c16bc28a60505fe5c
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Tue Apr 21 23:56:39 2015 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Tue Apr 21 23:56:39 2015 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=23d806ca

savecache: clean up creation of cache directory

The cache directory should be created via mkdir -p instead of
mkdir. This makes sure all parent directories are created.

Also, we now display an error message explaining that we were unable to
create the cache directory if creation fails.

 init.d/savecache.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/init.d/savecache.in b/init.d/savecache.in
index 9040732..ddd58d7 100644
--- a/init.d/savecache.in
+++ b/init.d/savecache.in
@@ -25,12 +25,12 @@ start()
        local rc=
        if [ ! -d "$RC_LIBEXECDIR"/cache ]; then
                rm -rf "$RC_LIBEXECDIR"/cache
-               if ! mkdir "$RC_LIBEXECDIR"/cache; then
+               if ! mkdir -p "$RC_LIBEXECDIR"/cache; then
                        rc=$?
                        if yesno "${RC_GOINGDOWN}"; then
                                rc=0
                        fi
-                       eend $rc
+                       eend $rc "Unable to create $RC_SVCDIR/cache"
                        return $rc
                fi
        fi

Reply via email to