From 62c923452080a17c25d87cc995b28e69f5deb3bf Mon Sep 17 00:00:00 2001 From: "Tomas V.V.Cox" Date: Wed, 23 Jan 2002 18:53:08 +0000 Subject: [PATCH] Return false when the directory can not be created in mkDir() --- pear/System.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pear/System.php b/pear/System.php index 939692b8a7..fd90901295 100644 --- a/pear/System.php +++ b/pear/System.php @@ -197,6 +197,7 @@ class System extends PEAR $mode = $opt[1]; } } + $ret = true; if (isset($create_parents)) { foreach($opts[1] as $dir) { $dirstack = array(); @@ -206,18 +207,18 @@ class System extends PEAR } while ($newdir = array_shift($dirstack)) { if (!mkdir($newdir, $mode)) { - break; // XXX error + $ret = false; } } } } else { foreach($opts[1] as $dir) { - if (!mkdir($dir, $mode)) { - continue; // XXX error + if (!@is_dir($dir) && !mkdir($dir, $mode)) { + $ret = false; } } } - return true; + return $ret; } /** -- 2.50.1