Commit 7e5e1ff2 authored by Radostin Stoyanov's avatar Radostin Stoyanov Committed by Pavel Emelyanov

test: Don't leak file descriptor

Signed-off-by: 's avatarRadostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent d76ddb5e
......@@ -14,14 +14,14 @@ def create_fds():
os.rmdir(tdir)
mnt_id = -1;
f = open("/proc/self/fdinfo/%d" % fd1.fileno())
for l in f:
l = l.split()
if l[0] == "mnt_id:":
mnt_id = int(l[1])
break
else:
raise Exception("Unable to find mnt_id")
with open("/proc/self/fdinfo/%d" % fd1.fileno()) as f:
for l in f:
l = l.split()
if l[0] == "mnt_id:":
mnt_id = int(l[1])
break
else:
raise Exception("Unable to find mnt_id")
global id_str
id_str = "file[%x:%x]" % (mnt_id, os.fstat(fd1.fileno()).st_ino)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment