am 9cec175c: Remove a stray newline in the backtrace output.

* commit '9cec175c66100d9edbb1054f3f2977a5c3f80af2':
  Remove a stray newline in the backtrace output.
diff --git a/adb/usb_vendors.c b/adb/usb_vendors.c
index ed86b34..b988115 100644
--- a/adb/usb_vendors.c
+++ b/adb/usb_vendors.c
@@ -123,6 +123,8 @@
 #define VENDOR_ID_INQ_MOBILE    0x2314
 // Sony's USB Vendor ID
 #define VENDOR_ID_SONY          0x054C
+// Lab126's USB Vendor ID
+#define VENDOR_ID_LAB126        0x1949
 // Yulong Coolpad's USB Vendor ID
 #define VENDOR_ID_YULONG_COOLPAD 0x1EBF
 
@@ -172,6 +174,7 @@
     VENDOR_ID_QUANTA,
     VENDOR_ID_INQ_MOBILE,
     VENDOR_ID_SONY,
+    VENDOR_ID_LAB126,
     VENDOR_ID_YULONG_COOLPAD,
 };
 
diff --git a/adb/usb_windows.c b/adb/usb_windows.c
index b216999..251bf17 100644
--- a/adb/usb_windows.c
+++ b/adb/usb_windows.c
@@ -255,7 +255,7 @@
 }
 
 int usb_write(usb_handle* handle, const void* data, int len) {
-  unsigned long time_out = 500 + len * 8;
+  unsigned long time_out = 5000;
   unsigned long written = 0;
   int ret;
 
@@ -300,7 +300,7 @@
 }
 
 int usb_read(usb_handle *handle, void* data, int len) {
-  unsigned long time_out = 500 + len * 8;
+  unsigned long time_out = 0;
   unsigned long read = 0;
   int ret;
 
@@ -322,7 +322,7 @@
 
         if (len == 0)
           return 0;
-      } else if (saved_errno != ERROR_SEM_TIMEOUT) {
+      } else {
         // assume ERROR_INVALID_HANDLE indicates we are disconnected
         if (saved_errno == ERROR_INVALID_HANDLE)
           usb_kick(handle);
diff --git a/debuggerd/tombstone.c b/debuggerd/tombstone.c
index 2e92846..16b4943 100644
--- a/debuggerd/tombstone.c
+++ b/debuggerd/tombstone.c
@@ -336,13 +336,11 @@
      * Search for a match, or for a hole where the match would be.  The list
      * is backward from the file content, so it starts at high addresses.
      */
-    bool found = false;
     map_info_t* map = context->map_info_list;
     map_info_t *next = NULL;
     map_info_t *prev = NULL;
     while (map != NULL) {
         if (addr >= map->start && addr < map->end) {
-            found = true;
             next = map->next;
             break;
         } else if (addr >= map->end) {
diff --git a/init/builtins.c b/init/builtins.c
index a7e34a6..ac9585e 100644
--- a/init/builtins.c
+++ b/init/builtins.c
@@ -332,6 +332,7 @@
     unsigned flag;
 } mount_flags[] = {
     { "noatime",    MS_NOATIME },
+    { "noexec",     MS_NOEXEC },
     { "nosuid",     MS_NOSUID },
     { "nodev",      MS_NODEV },
     { "nodiratime", MS_NODIRATIME },
diff --git a/libpixelflinger/fixed.cpp b/libpixelflinger/fixed.cpp
index 5b92062..5094537 100644
--- a/libpixelflinger/fixed.cpp
+++ b/libpixelflinger/fixed.cpp
@@ -62,7 +62,8 @@
     int shift;
     x = gglRecipQNormalized(x, &shift);
     shift += 16-q;
-    x += 1L << (shift-1);   // rounding
+    if (shift > 0)
+        x += 1L << (shift-1);   // rounding
     x >>= shift;
     return x;
 }    
diff --git a/libsysutils/src/SocketClient.cpp b/libsysutils/src/SocketClient.cpp
index 4a1227f..3d4984d 100644
--- a/libsysutils/src/SocketClient.cpp
+++ b/libsysutils/src/SocketClient.cpp
@@ -131,11 +131,6 @@
 
 
 int SocketClient::sendMsg(const char *msg) {
-    if (mSocket < 0) {
-        errno = EHOSTUNREACH;
-        return -1;
-    }
-
     // Send the message including null character
     if (sendData(msg, strlen(msg) + 1) != 0) {
         SLOGW("Unable to send msg '%s'", msg);
@@ -158,6 +153,11 @@
     const char *p = (const char*) data;
     int brtw = len;
 
+    if (mSocket < 0) {
+        errno = EHOSTUNREACH;
+        return -1;
+    }
+
     if (len == 0) {
         return 0;
     }
diff --git a/toolbox/rm.c b/toolbox/rm.c
index bd66311..3a24bec 100644
--- a/toolbox/rm.c
+++ b/toolbox/rm.c
@@ -7,14 +7,17 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
+#define OPT_RECURSIVE 1
+#define OPT_FORCE     2
+
 static int usage()
 {
-    fprintf(stderr,"rm [-rR] <target>\n");
+    fprintf(stderr,"Usage: rm [-rR] [-f] <target>\n");
     return -1;
 }
 
 /* return -1 on failure, with errno set to the first error */
-static int unlink_recursive(const char* name)
+static int unlink_recursive(const char* name, int flags)
 {
     struct stat st;
     DIR *dir;
@@ -23,7 +26,7 @@
 
     /* is it a file or directory? */
     if (lstat(name, &st) < 0)
-        return -1;
+        return ((flags & OPT_FORCE) && errno == ENOENT) ? 0 : -1;
 
     /* a file, so unlink it */
     if (!S_ISDIR(st.st_mode))
@@ -41,7 +44,7 @@
         if (!strcmp(de->d_name, "..") || !strcmp(de->d_name, "."))
             continue;
         sprintf(dn, "%s/%s", name, de->d_name);
-        if (unlink_recursive(dn) < 0) {
+        if (unlink_recursive(dn, flags) < 0) {
             fail = 1;
             break;
         }
@@ -66,21 +69,45 @@
 int rm_main(int argc, char *argv[])
 {
     int ret;
-    int i = 1;
-    int recursive = 0;
+    int i, c;
+    int flags = 0;
 
     if (argc < 2)
         return usage();
 
-    /* check if recursive */
-    if (argc >=2 && (!strcmp(argv[1], "-r") || !strcmp(argv[1], "-R"))) {
-        recursive = 1;
-        i = 2;
+    /* check flags */
+    do {
+        c = getopt(argc, argv, "frR");
+        if (c == EOF)
+            break;
+        switch (c) {
+        case 'f':
+            flags |= OPT_FORCE;
+            break;
+        case 'r':
+        case 'R':
+            flags |= OPT_RECURSIVE;
+            break;
+        }
+    } while (1);
+
+    if (optind < 1 || optind >= argc) {
+        usage();
+        return -1;
     }
-    
+
     /* loop over the file/directory args */
-    for (; i < argc; i++) {
-        int ret = recursive ? unlink_recursive(argv[i]) : unlink(argv[i]);
+    for (i = optind; i < argc; i++) {
+
+        if (flags & OPT_RECURSIVE) {
+            ret = unlink_recursive(argv[i], flags);
+        } else {
+            ret = unlink(argv[i]);
+            if (errno == ENOENT && (flags & OPT_FORCE)) {
+                return 0;
+            }
+        }
+
         if (ret < 0) {
             fprintf(stderr, "rm failed for %s, %s\n", argv[i], strerror(errno));
             return -1;