OSDN Git Service

Merge tag 'android-8.1.0_r1' into oreo-x86
[android-x86/external-toybox.git] / main.c
diff --git a/main.c b/main.c
index a2267da..6025d43 100644 (file)
--- a/main.c
+++ b/main.c
@@ -6,7 +6,7 @@
 #include "toys.h"
 
 #ifndef TOYBOX_VERSION
-#define TOYBOX_VERSION "0.7.2"
+#define TOYBOX_VERSION "0.7.4"
 #endif
 
 // Populate toy_list[].
@@ -49,7 +49,7 @@ struct toy_list *toy_find(char *name)
     if (middle<bottom || middle>top) return NULL;
     result = strcmp(name,toy_list[middle].name);
     if (!result) return toy_list+middle;
-    if (result<0) top=--middle;
+    if (result<0) top = --middle;
     else bottom = ++middle;
   }
 }
@@ -213,8 +213,12 @@ int main(int argc, char *argv[])
   }
   *argv = getbasename(*argv);
 
-  // Bionic's dynamic linker adds a handler to report SIGPIPE as an error,
-  // then doesn't want that behavior for toybox. So disable it for bionic.
+  // Up to and including Android M, bionic's dynamic linker added a handler to
+  // cause a crash dump on SIGPIPE. That was removed in Android N, but adbd
+  // was still setting the SIGPIPE disposition to SIG_IGN, and its children
+  // were inheriting that. In Android O, adbd is fixed, but manually asking
+  // for the default disposition is harmless, and it'll be a long time before
+  // no one's using anything older than O!
   if (CFG_TOYBOX_ON_ANDROID) signal(SIGPIPE, SIG_DFL);
 
   // If nommu can't fork, special reentry path.