From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 0CC9F2018B for ; Sun, 19 Jun 2016 00:28:50 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/4] emergency: avoid needless mkpath dependency Date: Sun, 19 Jun 2016 00:28:44 +0000 Message-Id: <20160619002847.26685-2-e@80x24.org> In-Reply-To: <20160619002847.26685-1-e@80x24.org> References: <20160619002847.26685-1-e@80x24.org> List-Id: Be more explicit and slightly speed up tests. --- lib/PublicInbox/Emergency.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/Emergency.pm b/lib/PublicInbox/Emergency.pm index e402d30..4ee8621 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; }