Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only run udevadm if it exists #36

Merged
merged 2 commits into from
Apr 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions bin/growpart
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,14 @@ unlock_disk_and_settle() {
local settle=${2-"1"}
# release the lock on a disk if locked. When a disk is locked,
# FLOCK_DISK_FD is set to the hard-coded value of 9.
# After unlocking run udevadm settle as the disk has likely been changed.
# After unlocking run udevadm settle (if installed) as the disk has
# likely been changed.
[ "${DRY_RUN}" = 0 ] || return
[ -n "${FLOCK_DISK_FD}" ] || return

debug 1 "FLOCK: ${disk}: releasing exclusive lock"
exec 9>&-
[ "${settle}" = 1 ] && udevadm settle
[ "${settle}" = 1 ] && has_cmd udevadm && udevadm settle
FLOCK_DISK_FD=""
}

Expand Down