summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-09-29 02:43:53 +0200
committerTao Bao <tbao@google.com>2017-09-29 03:25:04 +0200
commitac27a7a98733ea2444eedacfd2d8dd4a384726f6 (patch)
tree05c3940cf8aaf70876471a3478a681d2df6760d8
parentMerge "roots: volume_for_path() parses and tries prefixes." (diff)
downloadandroid_bootable_recovery-ac27a7a98733ea2444eedacfd2d8dd4a384726f6.tar
android_bootable_recovery-ac27a7a98733ea2444eedacfd2d8dd4a384726f6.tar.gz
android_bootable_recovery-ac27a7a98733ea2444eedacfd2d8dd4a384726f6.tar.bz2
android_bootable_recovery-ac27a7a98733ea2444eedacfd2d8dd4a384726f6.tar.lz
android_bootable_recovery-ac27a7a98733ea2444eedacfd2d8dd4a384726f6.tar.xz
android_bootable_recovery-ac27a7a98733ea2444eedacfd2d8dd4a384726f6.tar.zst
android_bootable_recovery-ac27a7a98733ea2444eedacfd2d8dd4a384726f6.zip
Diffstat (limited to '')
-rw-r--r--otafault/Android.mk2
-rw-r--r--otafault/config.cpp6
-rw-r--r--otafault/config.h20
-rw-r--r--otafault/ota_io.cpp4
-rw-r--r--otafault/ota_io.h3
-rw-r--r--otafault/test.cpp3
6 files changed, 18 insertions, 20 deletions
diff --git a/otafault/Android.mk b/otafault/Android.mk
index 4784d56ef..383717612 100644
--- a/otafault/Android.mk
+++ b/otafault/Android.mk
@@ -18,8 +18,6 @@ include $(CLEAR_VARS)
otafault_static_libs := \
libziparchive \
- libz \
- libselinux \
libbase \
liblog
diff --git a/otafault/config.cpp b/otafault/config.cpp
index b94e429c6..c11f77452 100644
--- a/otafault/config.cpp
+++ b/otafault/config.cpp
@@ -14,16 +14,14 @@
* limitations under the License.
*/
+#include "config.h"
+
#include <map>
#include <string>
-#include <stdio.h>
-#include <unistd.h>
-
#include <android-base/stringprintf.h>
#include <ziparchive/zip_archive.h>
-#include "config.h"
#include "ota_io.h"
#define OTAIO_MAX_FNAME_SIZE 128
diff --git a/otafault/config.h b/otafault/config.h
index 4adbdd121..cc4bfd2ad 100644
--- a/otafault/config.h
+++ b/otafault/config.h
@@ -15,13 +15,13 @@
*/
/*
- * Read configuration files in the OTA package to determine which files, if any, will trigger errors.
+ * Read configuration files in the OTA package to determine which files, if any, will trigger
+ * errors.
*
- * OTA packages can be modified to trigger errors by adding a top-level
- * directory called .libotafault, which may optionally contain up to three
- * files called READ, WRITE, and FSYNC. Each one of these optional files
- * contains the name of a single file on the device disk which will cause
- * an IO error on the first call of the appropriate I/O action to that file.
+ * OTA packages can be modified to trigger errors by adding a top-level directory called
+ * .libotafault, which may optionally contain up to three files called READ, WRITE, and FSYNC.
+ * Each one of these optional files contains the name of a single file on the device disk which
+ * will cause an IO error on the first call of the appropriate I/O action to that file.
*
* Example:
* ota.zip
@@ -29,9 +29,9 @@
* .libotafault
* WRITE
*
- * If the contents of the file WRITE were /system/build.prop, the first write
- * action to /system/build.prop would fail with EIO. Note that READ and
- * FSYNC files are absent, so these actions will not cause an error.
+ * If the contents of the file WRITE were /system/build.prop, the first write action to
+ * /system/build.prop would fail with EIO. Note that READ and FSYNC files are absent, so these
+ * actions will not cause an error.
*/
#ifndef _UPDATER_OTA_IO_CFG_H_
@@ -39,8 +39,6 @@
#include <string>
-#include <stdbool.h>
-
#include <ziparchive/zip_archive.h>
#define OTAIO_BASE_DIR ".libotafault"
diff --git a/otafault/ota_io.cpp b/otafault/ota_io.cpp
index faae5275d..a82a7ee59 100644
--- a/otafault/ota_io.cpp
+++ b/otafault/ota_io.cpp
@@ -18,15 +18,17 @@
#include <errno.h>
#include <fcntl.h>
+#include <stdint.h>
#include <stdio.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
#include <map>
-#include <memory>
#include <mutex>
#include <android-base/thread_annotations.h>
+
#include "config.h"
static std::mutex filename_mutex;
diff --git a/otafault/ota_io.h b/otafault/ota_io.h
index 9428f1b1f..45e481a62 100644
--- a/otafault/ota_io.h
+++ b/otafault/ota_io.h
@@ -23,8 +23,9 @@
#ifndef _UPDATER_OTA_IO_H_
#define _UPDATER_OTA_IO_H_
+#include <stddef.h>
#include <stdio.h>
-#include <sys/stat.h>
+#include <sys/stat.h> // mode_t
#include <memory>
diff --git a/otafault/test.cpp b/otafault/test.cpp
index 6514782bf..60c40e099 100644
--- a/otafault/test.cpp
+++ b/otafault/test.cpp
@@ -14,9 +14,10 @@
* limitations under the License.
*/
-#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
#include "ota_io.h"