mirror of
https://github.com/xcat2/confluent.git
synced 2025-01-28 11:57:37 +00:00
Correct fd used in libarchive
Actually use the cloned file descriptors
This commit is contained in:
parent
ce92ea4084
commit
d08ce9e563
@ -228,7 +228,7 @@ def extract_file(archfile, flags=0, callback=lambda x: None, imginfo=(), extract
|
||||
dfd = os.dup(archfile.fileno())
|
||||
os.lseek(dfd, 0, 0)
|
||||
try:
|
||||
with libarchive.fd_reader(archfile.fileno()) as archive:
|
||||
with libarchive.fd_reader(dfd) as archive:
|
||||
extract_entries(archive, flags, callback, totalsize, extractlist)
|
||||
finally:
|
||||
os.close(dfd)
|
||||
@ -451,7 +451,7 @@ def scan_iso(archive):
|
||||
dfd = os.dup(archive.fileno())
|
||||
os.lseek(dfd, 0, 0)
|
||||
try:
|
||||
with libarchive.fd_reader(archive.fileno()) as reader:
|
||||
with libarchive.fd_reader(dfd) as reader:
|
||||
for ent in reader:
|
||||
if str(ent).endswith('TRANS.TBL'):
|
||||
continue
|
||||
|
Loading…
x
Reference in New Issue
Block a user