X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FCommon.pm;h=b0c6093c007301f840db44db591780d881101875;hb=b544c3be9dfe2e98386ea988c07c176b2de6d18e;hp=ae7d8b4724c32f693ab4ef76403e6b9ec9da2fa5;hpb=a62b19a9ba39ce1b719a47627853042fce3b3941;p=debbugs.git diff --git a/Debbugs/Common.pm b/Debbugs/Common.pm index ae7d8b4..b0c6093 100644 --- a/Debbugs/Common.pm +++ b/Debbugs/Common.pm @@ -74,6 +74,8 @@ use Mail::Address; use Cwd qw(cwd); use Storable qw(dclone); use Time::HiRes qw(usleep); +use File::Path qw(mkpath); +use File::Basename qw(dirname); use Params::Validate qw(validate_with :types); @@ -792,6 +794,7 @@ sub lockpid { unlink $pidfile or die "Unable to unlink stale pidfile $pidfile $!"; } + mkpath(dirname($pidfile)); my $pidfh = IO::File->new($pidfile,O_CREAT|O_EXCL|O_WRONLY) or die "Unable to open $pidfile for writing: $!"; print {$pidfh} $$ or die "Unable to write to $pidfile $!";