Compile delta_generator for the host.
Bug: 24619596
TEST=mma on linux.
Change-Id: Icccae2b938b4fdd698b177beee96ffb62e9f63ae
diff --git a/payload_consumer/delta_performer.cc b/payload_consumer/delta_performer.cc
index 6261cb1..e56bb75 100644
--- a/payload_consumer/delta_performer.cc
+++ b/payload_consumer/delta_performer.cc
@@ -882,10 +882,15 @@
TEST_AND_RETURN_FALSE(!operation.has_data_offset());
TEST_AND_RETURN_FALSE(!operation.has_data_length());
+#ifdef BLKZEROOUT
+ bool attempt_ioctl = true;
int request =
(operation.type() == InstallOperation::ZERO ? BLKZEROOUT : BLKDISCARD);
+#else // !defined(BLKZEROOUT)
+ bool attempt_ioctl = false;
+ int request = 0;
+#endif // !defined(BLKZEROOUT)
- bool attempt_ioctl = true;
brillo::Blob zeros;
for (int i = 0; i < operation.dst_extents_size(); i++) {
Extent extent = operation.dst_extents(i);
diff --git a/payload_consumer/file_descriptor.cc b/payload_consumer/file_descriptor.cc
index f26be28..309c60d 100644
--- a/payload_consumer/file_descriptor.cc
+++ b/payload_consumer/file_descriptor.cc
@@ -69,6 +69,11 @@
uint64_t start,
uint64_t length,
int* result) {
+ // If the ioctl BLKZEROOUT is not defined, just fail to perform any of these
+ // operations.
+#ifndef BLKZEROOUT
+ return false;
+#else // defined(BLKZEROOUT)
DCHECK(request == BLKDISCARD || request == BLKZEROOUT ||
request == BLKSECDISCARD);
// On some devices, the BLKDISCARD will actually read back as zeros, instead
@@ -99,6 +104,7 @@
return false;
}
return true;
+#endif // defined(BLKZEROOUT)
}
bool EintrSafeFileDescriptor::Close() {