[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1/2] tools/helpers: Introduce cmp-fd-file-inode utility

On Feb 26, 2020, at 11:07, Jason Andryuk <jandryuk@xxxxxxxxx> wrote:
>> On Wed, Feb 26, 2020 at 10:48 AM Ian Jackson <ian.jackson@xxxxxxxxxx> wrote:
>> Jason Andryuk writes ("[PATCH 1/2] tools/helpers: Introduce 
>> cmp-fd-file-inode utility"):
>>> This is a C implementation of the perl code inside of locking.sh to
>>> check that the locked file descriptor and lock file share the same inode
>>> and therefore match.  One change from the perl version is replacing
>>> printing "y" on success with exit values of 0 (shell True) and 1 (shell
>>> False).
>> Maybe it would be better to use stat(1) ?  On Linux
>> stat -L -c%D.%i /dev/stdin blah.lock
>> or some such, and then compare the two numbers.
>> I'm reluctant to host a general-purpose shell utility in xen.git, no
>> matter how useful...

We've used this downstream in OpenXT to avoid pulling in the general-purpose 
Perl runtime, which is..larger than this special-purpose utility.  This shell 
utility was developed for this specific use case in Xen.

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.