Merge "Fix bogus error checking on unique_fd" am: a0fe1227b8
am: 7367caad0f
Change-Id: I46a97ce8c85b186f8d7d5c4e7507b4063cc5c710
This commit is contained in:
@@ -76,7 +76,7 @@ static bool ReadPartitionToBuffer(const Partition& partition, FileContents* out,
|
|||||||
}
|
}
|
||||||
|
|
||||||
android::base::unique_fd dev(open(partition.name.c_str(), O_RDONLY));
|
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 << "\"";
|
PLOG(ERROR) << "Failed to open eMMC partition \"" << partition << "\"";
|
||||||
} else {
|
} else {
|
||||||
std::vector<unsigned char> buffer(partition.size);
|
std::vector<unsigned char> buffer(partition.size);
|
||||||
|
|||||||
@@ -392,7 +392,7 @@ int run_fuse_sideload(std::unique_ptr<FuseDataProvider>&& provider, const char*
|
|||||||
}
|
}
|
||||||
|
|
||||||
fd.ffd.reset(open("/dev/fuse", O_RDWR));
|
fd.ffd.reset(open("/dev/fuse", O_RDWR));
|
||||||
if (!fd.ffd) {
|
if (fd.ffd == -1) {
|
||||||
perror("open /dev/fuse");
|
perror("open /dev/fuse");
|
||||||
result = -1;
|
result = -1;
|
||||||
goto done;
|
goto done;
|
||||||
|
|||||||
Reference in New Issue
Block a user