X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FEmergency.pm;h=231b419741638c0a65059fd97f844a98b5e6c0c5;hb=3d41aa23f35501ca92aab8aa42980fa73f7fa74f;hp=e402d30f848342800efb4891c46fc0b826dd585f;hpb=c1abb946e53e4179666ebb290e31c2d9ddc40711;p=public-inbox.git diff --git a/lib/PublicInbox/Emergency.pm b/lib/PublicInbox/Emergency.pm index e402d30f..231b4197 100644 --- a/lib/PublicInbox/Emergency.pm +++ b/lib/PublicInbox/Emergency.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2016 all contributors +# Copyright (C) 2016-2018 all contributors # License: AGPL-3.0+ # # Emergency Maildir delivery for MDA @@ -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; }