aboutsummaryrefslogtreecommitdiffstats
path: root/main/xen/xen-hotplug-lockfd.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-10-09 16:10:28 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-10-09 16:10:28 +0000
commit0c5e302b3f9267c3a929531f848bf98398f48485 (patch)
treea5f2c3abc574e9c79b91dfb49ecf7a0e3f707cc9 /main/xen/xen-hotplug-lockfd.patch
parentc2fa69955ac724d03c7c50f155e1a2dabc125c3c (diff)
downloadaports-0c5e302b3f9267c3a929531f848bf98398f48485.tar.bz2
aports-0c5e302b3f9267c3a929531f848bf98398f48485.tar.xz
main/xen: remove perl dependency
use a tiny C program to do the file/fd compare instead of perl
Diffstat (limited to 'main/xen/xen-hotplug-lockfd.patch')
-rw-r--r--main/xen/xen-hotplug-lockfd.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/main/xen/xen-hotplug-lockfd.patch b/main/xen/xen-hotplug-lockfd.patch
new file mode 100644
index 0000000000..2f91889948
--- /dev/null
+++ b/main/xen/xen-hotplug-lockfd.patch
@@ -0,0 +1,24 @@
+We remove the perl snippet to verify the lockfile with lockfd to
+avoid perl dependency
+
+use a tiny C app to do the same job.
+
+--- ./tools/hotplug/Linux/locking.sh.orig
++++ ./tools/hotplug/Linux/locking.sh
+@@ -51,14 +51,8 @@
+ # actually a synthetic symlink in /proc and we aren't
+ # guaranteed that our stat(2) won't lose the race with an
+ # rm(1) between reading the synthetic link and traversing the
+- # file system to find the inum. Perl is very fast so use that.
+- rightfile=$( perl -e '
+- open STDIN, "<&'$_lockfd'" or die $!;
+- my $fd_inum = (stat STDIN)[1]; die $! unless defined $fd_inum;
+- my $file_inum = (stat $ARGV[0])[1];
+- print "y\n" if $fd_inum eq $file_inum;
+- ' "$_lockfile" )
+- if [ x$rightfile = xy ]; then break; fi
++ # file system to find the inum. We use tiny C file for that
++ if /usr/lib/xen/bin/xen-fd-is-file $_lockfd $_lockfile; then break; fi
+ # Some versions of bash appear to be buggy if the same
+ # $_lockfile is opened repeatedly. Close the current fd here.
+ eval "exec $_lockfd<&-"