From: Eric Wong Date: Sat, 18 Jun 2016 22:11:01 +0000 (+0000) Subject: emergency: avoid needless mkpath dependency X-Git-Tag: v1.0.0~412 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=f7db02b9aec08b37e08893e6e96c07725a0c1620 emergency: avoid needless mkpath dependency Be more explicit and slightly speed up tests. --- 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; }