projects
/
public-inbox.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
26d8524
)
emergency: avoid needless mkpath dependency
author
Eric Wong <e@80x24.org>
Sat, 18 Jun 2016 22:11:01 +0000 (22:11 +0000)
committer
Eric Wong <e@80x24.org>
Sat, 18 Jun 2016 22:11:01 +0000 (22:11 +0000)
Be more explicit and slightly speed up tests.
lib/PublicInbox/Emergency.pm
patch
|
blob
|
history
diff --git
a/lib/PublicInbox/Emergency.pm
b/lib/PublicInbox/Emergency.pm
index e402d30f848342800efb4891c46fc0b826dd585f..4ee862153fdfe3d80d4735b68b7d0e32a5cd43cd 100644
(file)
--- 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;
}