Skip to content

Commit

Permalink
inhibit: use hintFile()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sergio-costas committed Oct 7, 2022
1 parent 79fe81d commit 7690b9c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cmd/snaplock/runinhibit/inhibit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 7690b9c

Please sign in to comment.