diff options
author | David Turner <digit@android.com> | 2010-06-07 15:32:03 -0700 |
---|---|---|
committer | Android Code Review <code-review@android.com> | 2010-06-07 15:32:03 -0700 |
commit | 3f7087032bba4b7ea52b6bd391d8f3005d51230a (patch) | |
tree | 43112b970512311951e621af9cdc4e15dac7c847 | |
parent | 4ecdc519b4c59d9dce1da2b8b926e4a6c2faad16 (diff) | |
parent | 7e6a43495b0ee828f56e4b7ba146c6f9b5849128 (diff) | |
download | sdk-3f7087032bba4b7ea52b6bd391d8f3005d51230a.zip sdk-3f7087032bba4b7ea52b6bd391d8f3005d51230a.tar.gz sdk-3f7087032bba4b7ea52b6bd391d8f3005d51230a.tar.bz2 |
Merge "qemu-props: Signal end of property list."
-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); |