From 634707c954137bdf638ba6368b166a1defd7056a Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Mon, 17 Aug 2020 04:54:04 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20#208=20=E2=80=94=20=F0=9F=90=9B=20Check?= =?UTF-8?q?=20if=20provisioning=20lockfile=20mod=20time=20exists=20before?= =?UTF-8?q?=20using=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG | 2 ++ lib/Lufi.pm | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 60e11fd..d2a401c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,8 @@ Revision history for Lufi ?.??.? ????-??-?? + - 🐛 Check if provisioning lockfile mod time exists before using it (#208) + 0.05.2 2020-07-25 - 🔥 Remove code from abandonned feature - Fix regression introduced in 0.05.1 (#201) diff --git a/lib/Lufi.pm b/lib/Lufi.pm index 9daef2f..085d248 100644 --- a/lib/Lufi.pm +++ b/lib/Lufi.pm @@ -83,7 +83,7 @@ sub startup { my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($lockfile); # Remove the lockfile if more than 20 seconds old - if (time - $mtime > 20) { + if ($mtime && time - $mtime > 20) { unlink $lockfile if -e $lockfile; # if -e just to be sure the file hasn’t been removed while checking it } else { return;