Merge "Increase minimum thread size for 64 bit."
diff --git a/libc/bionic/system_properties.cpp b/libc/bionic/system_properties.cpp
index ec3d04b..97e1a03 100644
--- a/libc/bionic/system_properties.cpp
+++ b/libc/bionic/system_properties.cpp
@@ -655,23 +655,6 @@
     return 0;
 }
 
-int __system_property_wait(const prop_info *pi)
-{
-    if (pi == 0) {
-        prop_area *pa = __system_property_area__;
-        const uint32_t n = pa->serial;
-        do {
-            __futex_wait(&pa->serial, n, NULL);
-        } while (n == pa->serial);
-    } else {
-        const uint32_t n = pi->serial;
-        do {
-            __futex_wait((volatile void *)&pi->serial, n, NULL);
-        } while (n == pi->serial);
-    }
-    return 0;
-}
-
 int __system_property_update(prop_info *pi, const char *value, unsigned int len)
 {
     prop_area *pa = __system_property_area__;
diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp
index 2a0549a..3194e59 100644
--- a/tests/stdio_test.cpp
+++ b/tests/stdio_test.cpp
@@ -17,6 +17,7 @@
 #include <gtest/gtest.h>
 
 #include <errno.h>
+#include <fcntl.h>
 #include <limits.h>
 #include <math.h>
 #include <stdio.h>
@@ -407,6 +408,28 @@
   EXPECT_STREQ("-0.000000", buf);
 }
 
+TEST(stdio, fprintf_failures_7229520) {
+  FILE* fp;
+
+  // Unbuffered case where the fprintf(3) itself fails.
+  ASSERT_NE(nullptr, fp = tmpfile());
+  setbuf(fp, NULL);
+  ASSERT_EQ(4, fprintf(fp, "epic"));
+  ASSERT_EQ(0, close(fileno(fp)));
+  ASSERT_EQ(-1, fprintf(fp, "fail"));
+  ASSERT_EQ(-1, fclose(fp));
+
+  // Buffered case where we won't notice until the fclose(3).
+  // It's likely this is what was actually seen in http://b/7229520,
+  // and that expecting fprintf to fail is setting yourself up for
+  // disappointment. Remember to check fclose(3)'s return value, kids!
+  ASSERT_NE(nullptr, fp = tmpfile());
+  ASSERT_EQ(4, fprintf(fp, "epic"));
+  ASSERT_EQ(0, close(fileno(fp)));
+  ASSERT_EQ(4, fprintf(fp, "fail"));
+  ASSERT_EQ(-1, fclose(fp));
+}
+
 TEST(stdio, popen) {
   FILE* fp = popen("cat /proc/version", "r");
   ASSERT_TRUE(fp != NULL);