diff options
author | Dries Harnie <botje.linux@gmail.com> | 2010-06-07 23:41:00 +0200 |
---|---|---|
committer | Dries Harnie <botje.linux@gmail.com> | 2010-06-07 23:41:00 +0200 |
commit | 7e6a43495b0ee828f56e4b7ba146c6f9b5849128 (patch) | |
tree | 767766bbd5dad254979ff3989467693041aaf31c /emulator | |
parent | 849372361326db2075fbe65528e4d630781b00a0 (diff) | |
download | sdk-7e6a43495b0ee828f56e4b7ba146c6f9b5849128.zip sdk-7e6a43495b0ee828f56e4b7ba146c6f9b5849128.tar.gz sdk-7e6a43495b0ee828f56e4b7ba146c6f9b5849128.tar.bz2 |
qemu-props: Signal end of property list.
Change-Id: I16f8c8b370f42c6229b3deabd66d2aaabd0b7937
Diffstat (limited to 'emulator')
-rw-r--r-- | emulator/tools/qemu-props.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/emulator/tools/qemu-props.c b/emulator/tools/qemu-props.c index 09105fc..3f086a1 100644 --- a/emulator/tools/qemu-props.c +++ b/emulator/tools/qemu-props.c @@ -80,12 +80,13 @@ int main(void) for (;;) { #define BUFF_SIZE (PROPERTY_KEY_MAX + PROPERTY_VALUE_MAX + 2) - + DD("receiving.."); char* q; char temp[BUFF_SIZE]; int len = qemud_channel_recv(qemud_fd, temp, sizeof temp - 1); - if (len < 0 || len > BUFF_SIZE-1) + /* lone NUL-byte signals end of properties */ + if (len < 0 || len > BUFF_SIZE-1 || temp[0] == '\0') break; temp[len] = '\0'; /* zero-terminate string */ @@ -107,6 +108,7 @@ int main(void) } } + /* finally, close the channel and exit */ close(qemud_fd); DD("exiting (%d properties set).", count); |