]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - make/console.pm
Extract directory creation code to its own subroutine.
[user/henk/code/inspircd.git] / make / console.pm
index 4e7b32d4963b01185923830b612d330d3933b0f9..621de0274293815f8c5bcbd728310ea3d41b4d2e 100644 (file)
@@ -88,12 +88,8 @@ sub prompt_dir($$$;$) {
                $answer = rel2abs(prompt_string($interactive, $question, $default));
                $create = prompt_bool($interactive && !-d $answer, "$answer does not exist. Create it?", 'y');
                if ($create && $create_now) {
-                       my $mkpath = eval {
-                               mkpath($answer, 0, 0750);
-                               return 1;
-                       };
-                       unless (defined $mkpath) {
-                               print_warning "unable to create $answer!\n";
+                       unless (create_directory $answer, 0750) {
+                               print_warning "unable to create $answer: $!\n";
                                $create = 0;
                        }
                }