From 23d806ca24845261fd89104c16bc28a60505fe5c Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Tue, 21 Apr 2015 18:56:39 -0500 Subject: 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 9040732c..ddd58d7e 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 -- cgit v1.2.3