diff --git a/cmds/atrace/atrace.cpp b/cmds/atrace/atrace.cpp
index 9e5c910..010d9ce 100644
--- a/cmds/atrace/atrace.cpp
+++ b/cmds/atrace/atrace.cpp
@@ -23,6 +23,7 @@
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/sendfile.h>
 #include <time.h>
 #include <zlib.h>
@@ -648,7 +649,7 @@
         uint8_t *in, *out;
         int result, flush;
 
-        bzero(&zs, sizeof(zs));
+        memset(&zs, 0, sizeof(zs));
         result = deflateInit(&zs, Z_DEFAULT_COMPRESSION);
         if (result != Z_OK) {
             fprintf(stderr, "error initializing zlib: %d\n", result);
diff --git a/cmds/bugreport/Android.mk b/cmds/bugreport/Android.mk
index f476f5e..ced5d30 100644
--- a/cmds/bugreport/Android.mk
+++ b/cmds/bugreport/Android.mk
@@ -1,10 +1,12 @@
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
 
-LOCAL_SRC_FILES:= bugreport.c
+LOCAL_SRC_FILES:= bugreport.cpp
 
 LOCAL_MODULE:= bugreport
 
+LOCAL_CFLAGS := -Wall
+
 LOCAL_SHARED_LIBRARIES := libcutils
 
 include $(BUILD_EXECUTABLE)
diff --git a/cmds/bugreport/bugreport.c b/cmds/bugreport/bugreport.c
deleted file mode 100644
index 11e9057..0000000
--- a/cmds/bugreport/bugreport.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <cutils/properties.h>
-#include <cutils/sockets.h>
-
-int main(int argc, char *argv[]) {
-    char buffer[65536];
-    int i, s;
-
-    /* start the dumpstate service */
-    property_set("ctl.start", "dumpstate");
-
-    /* socket will not be available until service starts */
-    for (i = 0; i < 20; i++) {
-        s = socket_local_client("dumpstate",
-                             ANDROID_SOCKET_NAMESPACE_RESERVED,
-                             SOCK_STREAM);
-        if (s >= 0)
-            break;
-        /* try again in 1 second */
-        sleep(1);
-    }
-
-    if (s < 0) {
-        fprintf(stderr, "Failed to connect to dumpstate service\n");
-        exit(1);
-    }
-
-    while (1) {
-        int length = read(s, buffer, sizeof(buffer));
-        if (length <= 0)
-            break;
-        fwrite(buffer, 1, length, stdout);
-    }
-
-    close(s);
-    return 0;
-}
diff --git a/cmds/bugreport/bugreport.cpp b/cmds/bugreport/bugreport.cpp
new file mode 100644
index 0000000..b606406
--- /dev/null
+++ b/cmds/bugreport/bugreport.cpp
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <errno.h>
+#include <stdio.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <cutils/properties.h>
+#include <cutils/sockets.h>
+
+// This program will trigger the dumpstate service to start a call to
+// dumpstate, then connect to the dumpstate local client to read the
+// output. All of the dumpstate output is written to stdout, including
+// any errors encountered while reading/writing the output.
+int main() {
+  // Start the dumpstate service.
+  property_set("ctl.start", "dumpstate");
+
+  // Socket will not be available until service starts.
+  int s;
+  for (int i = 0; i < 20; i++) {
+    s = socket_local_client("dumpstate", ANDROID_SOCKET_NAMESPACE_RESERVED,
+                            SOCK_STREAM);
+    if (s >= 0)
+      break;
+    // Try again in 1 second.
+    sleep(1);
+  }
+
+  if (s == -1) {
+    printf("Failed to connect to dumpstate service: %s\n", strerror(errno));
+    return 1;
+  }
+
+  // Set a timeout so that if nothing is read in 3 minutes, we'll stop
+  // reading and quit. No timeout in dumpstate is longer than 60 seconds,
+  // so this gives lots of leeway in case of unforeseen time outs.
+  struct timeval tv;
+  tv.tv_sec = 3 * 60;
+  tv.tv_usec = 0;
+  if (setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) == -1) {
+    printf("WARNING: Cannot set socket timeout: %s\n", strerror(errno));
+  }
+
+  while (1) {
+    char buffer[65536];
+    ssize_t bytes_read = TEMP_FAILURE_RETRY(read(s, buffer, sizeof(buffer)));
+    if (bytes_read == 0) {
+      break;
+    } else if (bytes_read == -1) {
+      // EAGAIN really means time out, so change the errno.
+      if (errno == EAGAIN) {
+        errno = ETIMEDOUT;
+      }
+      printf("\nBugreport read terminated abnormally (%s).\n", strerror(errno));
+      break;
+    }
+
+    ssize_t bytes_to_send = bytes_read;
+    ssize_t bytes_written;
+    do {
+      bytes_written = TEMP_FAILURE_RETRY(write(STDOUT_FILENO,
+                                               buffer + bytes_read - bytes_to_send,
+                                               bytes_to_send));
+      if (bytes_written == -1) {
+        printf("Failed to write data to stdout: read %zd, trying to send %zd (%s)\n",
+               bytes_read, bytes_to_send, strerror(errno));
+        return 1;
+      }
+      bytes_to_send -= bytes_written;
+    } while (bytes_written != 0 && bytes_to_send > 0);
+  }
+
+  TEMP_FAILURE_RETRY(close(s));
+  return 0;
+}
diff --git a/include/ui/Region.h b/include/ui/Region.h
index 873cd34..49740f7 100644
--- a/include/ui/Region.h
+++ b/include/ui/Region.h
@@ -59,6 +59,7 @@
             void        clear();
             void        set(const Rect& r);
             void        set(int32_t w, int32_t h);
+            void        set(uint32_t w, uint32_t h);
 
             Region&     orSelf(const Rect& rhs);
             Region&     xorSelf(const Rect& rhs);
diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp
index 06ab3d0..91fa216 100644
--- a/libs/ui/Region.cpp
+++ b/libs/ui/Region.cpp
@@ -260,6 +260,12 @@
     mStorage.add(Rect(w, h));
 }
 
+void Region::set(uint32_t w, uint32_t h)
+{
+    mStorage.clear();
+    mStorage.add(Rect(w, h));
+}
+
 bool Region::isTriviallyEqual(const Region& region) const {
     return begin() == region.begin();
 }
