summaryrefslogtreecommitdiffstats
path: root/otafault
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-09-29 19:59:00 +0200
committerandroid-build-merger <android-build-merger@google.com>2017-09-29 19:59:00 +0200
commitb5dfc86eafef10c73904e161b604285e6346468e (patch)
tree32f0aa2fb44059a6e8ea60ac5699f7f076138280 /otafault
parentMerge "Integer overflow observed while formatting volume" am: 846f307c6f am: 4a20e8b68f (diff)
parentMerge "otafault: Clean up header inclusion." am: d9373cf621 (diff)
downloadandroid_bootable_recovery-b5dfc86eafef10c73904e161b604285e6346468e.tar
android_bootable_recovery-b5dfc86eafef10c73904e161b604285e6346468e.tar.gz
android_bootable_recovery-b5dfc86eafef10c73904e161b604285e6346468e.tar.bz2
android_bootable_recovery-b5dfc86eafef10c73904e161b604285e6346468e.tar.lz
android_bootable_recovery-b5dfc86eafef10c73904e161b604285e6346468e.tar.xz
android_bootable_recovery-b5dfc86eafef10c73904e161b604285e6346468e.tar.zst
android_bootable_recovery-b5dfc86eafef10c73904e161b604285e6346468e.zip
Diffstat (limited to 'otafault')
-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"