The generic failure case disappeared...

Was manifesting as a write to a full disk hanging indefinitely.

Bug: 19846181
Change-Id: Ia581e0bbbb331c221bdb68882c238d0cb9f8a0b3
diff --git a/adb/adb_io_test.cpp b/adb/adb_io_test.cpp
index 0c69bc9..da340b2 100644
--- a/adb/adb_io_test.cpp
+++ b/adb/adb_io_test.cpp
@@ -18,8 +18,11 @@
 
 #include <gtest/gtest.h>
 
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 #include <unistd.h>
 
 #include <string>
@@ -127,6 +130,15 @@
   EXPECT_EQ(expected, s);
 }
 
+TEST(io, WriteFdExactly_ENOSPC) {
+    int fd = open("/dev/full", O_WRONLY);
+    ASSERT_NE(-1, fd);
+
+    char buf[] = "foo";
+    ASSERT_FALSE(WriteFdExactly(fd, buf, sizeof(buf)));
+    ASSERT_EQ(ENOSPC, errno);
+}
+
 TEST(io, WriteStringFully) {
   const char str[] = "Foobar";
   TemporaryFile tf;