Skip to content

Commit

Permalink
Update QemuTransport#write() to match new write API contract. (apache…
Browse files Browse the repository at this point in the history
…#8761)

* suspect this should fix apache#8278
  • Loading branch information
areusch authored and ylc committed Jan 13, 2022
1 parent d407f5a commit d0f5360
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/microtvm/zephyr/template_project/microtvm_api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,9 +678,9 @@ def write(self, data, timeout_sec):
escape_pos.append(i)
to_write.append(b)

num_written = server.write_with_timeout(self.write_fd, to_write, timeout_sec)
num_written -= sum(1 if x < num_written else 0 for x in escape_pos)
return num_written
while to_write:
num_written = server.write_with_timeout(self.write_fd, to_write, timeout_sec)
to_write = to_write[num_written:]

def _qemu_check_stdout(self):
for line in self.proc.stdout:
Expand Down

0 comments on commit d0f5360

Please sign in to comment.