mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
lvmdbusd: Only read whats buffered
When reading data from stdout & stderr we were reading until the reading until we got None back which really isn't needed as the read will return everything that is available.
This commit is contained in:
parent
a7404b5b83
commit
064e24bc1e
@ -64,13 +64,9 @@ class LVMShellProxy(object):
|
||||
|
||||
for r in ready[0]:
|
||||
if r == self.lvm_shell.stdout.fileno():
|
||||
while True:
|
||||
tmp = self.lvm_shell.stdout.read()
|
||||
if tmp:
|
||||
stdout += tmp.decode("utf-8")
|
||||
else:
|
||||
break
|
||||
|
||||
elif r == self.report_r:
|
||||
while True:
|
||||
tmp = os.read(self.report_r, 16384)
|
||||
@ -82,12 +78,9 @@ class LVMShellProxy(object):
|
||||
break
|
||||
|
||||
elif r == self.lvm_shell.stderr.fileno():
|
||||
while True:
|
||||
tmp = self.lvm_shell.stderr.read()
|
||||
if tmp:
|
||||
stderr += tmp.decode("utf-8")
|
||||
else:
|
||||
break
|
||||
|
||||
# Check to see if the lvm process died on us
|
||||
if self.lvm_shell.poll():
|
||||
|
Loading…
Reference in New Issue
Block a user