about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-06-18 22:11:01 +0000
committerEric Wong <e@80x24.org>2016-06-18 22:11:01 +0000
commitf7db02b9aec08b37e08893e6e96c07725a0c1620 (patch)
tree699a4c43ab72725e4ac4891e9ec29a0353b96f23
parent26d8524281b1461a3a7e4a19f0db3180228f2877 (diff)
downloadpublic-inbox-f7db02b9aec08b37e08893e6e96c07725a0c1620.tar.gz
Be more explicit and slightly speed up tests.
-rw-r--r--lib/PublicInbox/Emergency.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/Emergency.pm b/lib/PublicInbox/Emergency.pm
index e402d30f..4ee86215 100644
--- a/lib/PublicInbox/Emergency.pm
+++ b/lib/PublicInbox/Emergency.pm
@@ -12,11 +12,11 @@ use IO::Handle;
 sub new {
         my ($class, $dir) = @_;
 
+        -d $dir or mkdir($dir) or die "failed to mkdir($dir): $!\n";
         foreach (qw(new tmp cur)) {
                 my $d = "$dir/$_";
                 next if -d $d;
-                require File::Path;
-                File::Path::mkpath($d); # croaks on fatal errors
+                -d $d or mkdir($d) or die "failed to mkdir($d): $!\n";
         }
         bless { dir => $dir, files => {}, t => 0, cnt => 0 }, $class;
 }