diff options
author | Eric Wong <e@80x24.org> | 2016-06-18 22:11:01 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-06-18 22:11:01 +0000 |
commit | f7db02b9aec08b37e08893e6e96c07725a0c1620 (patch) | |
tree | 699a4c43ab72725e4ac4891e9ec29a0353b96f23 | |
parent | 26d8524281b1461a3a7e4a19f0db3180228f2877 (diff) | |
download | public-inbox-f7db02b9aec08b37e08893e6e96c07725a0c1620.tar.gz |
Be more explicit and slightly speed up tests.
-rw-r--r-- | lib/PublicInbox/Emergency.pm | 4 |
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; } |