'Did we successfully grab the lock?
Because this class deletes the locked file when the lock is
released, it is possible another process removed and recreated
the file between us opening the file and acquiring the lock.
:param int fd: file descriptor of the opened file to lock
:returns: True if the lock was successfully acquired
:rtype: bool'

def _lock_success(self, fd):

    try:
        stat1 = os.stat(self._path)
    except OSError as err:
        if (err.errno == errno.ENOENT):
            return False
        raise
    stat2 = os.fstat(fd)
    return ((stat1.st_dev == stat2.st_dev) and (stat1.st_ino == stat2.st_ino))
