Merge "Fix bogus error checking on unique_fd" am: a0fe1227b8 am: 7367caad0f
am: 5e028e80cf
Change-Id: Ie850812c7050305c9ca987c63f088f655e250054
diff --git a/applypatch/applypatch.cpp b/applypatch/applypatch.cpp
index f9383dd..90d8e86 100644
--- a/applypatch/applypatch.cpp
+++ b/applypatch/applypatch.cpp
@@ -76,7 +76,7 @@
}
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 b5b6ac1..3d94803 100644
--- a/fuse_sideload/fuse_sideload.cpp
+++ b/fuse_sideload/fuse_sideload.cpp
@@ -392,7 +392,7 @@
}
fd.ffd.reset(open("/dev/fuse", O_RDWR));
- if (!fd.ffd) {
+ if (fd.ffd == -1) {
perror("open /dev/fuse");
result = -1;
goto done;