From f7db02b9aec08b37e08893e6e96c07725a0c1620 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 18 Jun 2016 22:11:01 +0000 Subject: emergency: avoid needless mkpath dependency Be more explicit and slightly speed up tests. --- lib/PublicInbox/Emergency.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/Emergency.pm') 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; } -- cgit v1.2.3-24-ge0c7