From 7690b9cdd775e358d79a51581e4038a24306a732 Mon Sep 17 00:00:00 2001 From: Sergio Costas Rodriguez Date: Thu, 29 Sep 2022 17:39:40 +0200 Subject: [PATCH] inhibit: use hintFile() The function IsLocked() manually builds the path of the hint file, instead of rely on the hintFile() function to get it, as all the other functions do. This patch fixes this. --- cmd/snaplock/runinhibit/inhibit.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/snaplock/runinhibit/inhibit.go b/cmd/snaplock/runinhibit/inhibit.go index e97fe4e4bdc..ac125330dde 100644 --- a/cmd/snaplock/runinhibit/inhibit.go +++ b/cmd/snaplock/runinhibit/inhibit.go @@ -118,8 +118,7 @@ func Unlock(snapName string) error { // It returns the current, non-empty hint if inhibition is in place. Otherwise // it returns an empty hint. func IsLocked(snapName string) (Hint, error) { - fname := filepath.Join(InhibitDir, snapName+".lock") - flock, err := osutil.OpenExistingLockForReading(fname) + flock, err := osutil.OpenExistingLockForReading(hintFile(snapName)) if os.IsNotExist(err) { return "", nil }