scripts: don't rely on "stat -" support
authorJan Beulich <jbeulich@suse.com>
Thu, 25 Jun 2020 15:16:02 +0000 (17:16 +0200)
committerWei Liu <wl@xen.org>
Fri, 26 Jun 2020 10:08:05 +0000 (10:08 +0000)
commitd3688bf60f798074bf38d712a3e15c88cfb81ed4
tree36a8617ae792e8d7db1e26178ba586524e33fbd2
parente4d2207165b379ec13c8b512936f63982af62d13
scripts: don't rely on "stat -" support

While commit b72682c602b8 ("scripts: Use stat to check lock claim")
validly indicates that stat has gained support for the special "-"
command line option in 2009, we should still try to avoid breaking being
able to run on even older distros. As it has been determined, contary to
the comment in the script using /dev/stdin (/proc/self/fd/$_lockfd) is
fine here, as Linux specially treats these /proc inodes.

Suggested-by: Ian Jackson <ian.jackson@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Tested-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
Release-acked-by: Paul Durrant <paul@xen.org>
tools/hotplug/Linux/locking.sh