loop: add Loop.is_bound_to helper
Add a `Loop.is_bound_to` helper that checks if the looback device is bound if is so if the backing file refers to the same file as `fd`. The latter is done by comparing the device and inode information.
This commit is contained in:
parent
d6c421faf3
commit
a367a0df1d
2 changed files with 33 additions and 0 deletions
|
|
@ -37,6 +37,8 @@ def test_basic(tempdir):
|
|||
f.flush()
|
||||
lo = ctl.loop_for_fd(f.fileno(), autoclear=True)
|
||||
|
||||
assert lo.is_bound_to(f.fileno())
|
||||
|
||||
sb = os.fstat(f.fileno())
|
||||
|
||||
assert lo
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue