diff options
author | Josh Gao <jmgao@google.com> | 2019-04-25 14:04:57 -0700 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2019-05-06 16:18:02 -0700 |
commit | 27241a7a960ba513f8c706ffc2c20bd667559138 (patch) | |
tree | ed8cfebac134028c9045a06231d8f3542fb2cb90 /adb/adb_utils_test.cpp | |
parent | 0cd8102bbd12fc1ebe01e5efd139368936c190f9 (diff) |
Revert "Revert "Add a way to turn off unique_fd's operator int.""
The original commit broke aosp-master-with-phones, because of
vendor libraries the depended on the int versions of libbase functions.
This patch reverts the revert, and also adds ABI-compatibility shims for
the replaced functions.
This reverts commit 2c58e1924a7bf1b44049764fddb40c1704dc288f.
Bug: http://b/131312539
Test: treehugger
Test: forrest run of aosp-master-with-phones
Change-Id: I75cc84ec8d963e20862f7662e8e2f409471f41cc
Diffstat (limited to 'adb/adb_utils_test.cpp')
-rw-r--r-- | adb/adb_utils_test.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/adb/adb_utils_test.cpp b/adb/adb_utils_test.cpp index bd676c2deb..cdca3aa321 100644 --- a/adb/adb_utils_test.cpp +++ b/adb/adb_utils_test.cpp @@ -149,13 +149,13 @@ TEST(adb_utils, mkdirs) { TEST(adb_utils, set_file_block_mode) { unique_fd fd(adb_open("/dev/null", O_RDWR | O_APPEND)); ASSERT_GE(fd, 0); - int flags = fcntl(fd, F_GETFL, 0); + int flags = fcntl(fd.get(), F_GETFL, 0); ASSERT_EQ(O_RDWR | O_APPEND, (flags & (O_RDWR | O_APPEND))); ASSERT_TRUE(set_file_block_mode(fd, false)); - int new_flags = fcntl(fd, F_GETFL, 0); + int new_flags = fcntl(fd.get(), F_GETFL, 0); ASSERT_EQ(flags | O_NONBLOCK, new_flags); ASSERT_TRUE(set_file_block_mode(fd, true)); - new_flags = fcntl(fd, F_GETFL, 0); + new_flags = fcntl(fd.get(), F_GETFL, 0); ASSERT_EQ(flags, new_flags); } #endif |