diff options
author | Bernie Innocenti <codewiz@google.com> | 2019-03-28 21:30:50 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-03-28 21:30:50 -0700 |
commit | 2cc882c2f86c63177027570bd68d4c3a7c034e13 (patch) | |
tree | 13ec966169408c527ea36dbab4f413224c160b3a | |
parent | 8c9e2206b8f887bf44604ae4016059baa67d807e (diff) | |
parent | 5e028e80cf1aa98c66f9867460426db2a81b349f (diff) | |
download | recovery-2cc882c2f86c63177027570bd68d4c3a7c034e13.tar.gz |
Merge "Fix bogus error checking on unique_fd" am: a0fe1227b8 am: 7367caad0f
am: 5e028e80cf
Change-Id: Ie850812c7050305c9ca987c63f088f655e250054
-rw-r--r-- | applypatch/applypatch.cpp | 2 | ||||
-rw-r--r-- | fuse_sideload/fuse_sideload.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/applypatch/applypatch.cpp b/applypatch/applypatch.cpp index f9383dde..90d8e860 100644 --- a/applypatch/applypatch.cpp +++ b/applypatch/applypatch.cpp @@ -76,7 +76,7 @@ static bool ReadPartitionToBuffer(const Partition& partition, FileContents* out, } android::base::unique_fd dev(open(partition.name.c_str(), O_RDONLY)); - if (!dev) { + if (dev == -1) { PLOG(ERROR) << "Failed to open eMMC partition \"" << partition << "\""; } else { std::vector<unsigned char> buffer(partition.size); diff --git a/fuse_sideload/fuse_sideload.cpp b/fuse_sideload/fuse_sideload.cpp index b5b6ac15..3d948030 100644 --- a/fuse_sideload/fuse_sideload.cpp +++ b/fuse_sideload/fuse_sideload.cpp @@ -392,7 +392,7 @@ int run_fuse_sideload(std::unique_ptr<FuseDataProvider>&& provider, const char* } fd.ffd.reset(open("/dev/fuse", O_RDWR)); - if (!fd.ffd) { + if (fd.ffd == -1) { perror("open /dev/fuse"); result = -1; goto done; |