summaryrefslogtreecommitdiffstats
path: root/otafault/ota_io.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* otafault: Add the missing #include <string>.Tao Bao2017-10-111-0/+1
| | | | | Test: mmma bootable/recovery Change-Id: If7610ba55a2d2dd4257ff38c44d252c9c6bbfe40
* otafault: Move headers under otafault/.Tao Bao2017-09-291-2/+2
| | | | | Test: mmma bootable/recovery Change-Id: I3ceb72f703c7c2857d656c137d71baa1fccd8238
* otafault: Clean up header inclusion.Tao Bao2017-09-291-1/+3
| | | | | | | | Remove unneeded #includes. Also remove unneeded dependency on libz and libselinux. Test: mmma bootable/recovery Change-Id: Ic8f7f46f4b89762dee384921504489de75320ac0
* Protect filename_cache with lock in ota faultTianjie Xu2017-04-111-2/+16
| | | | | | Bug: 33173924 Test: Apply a successfully update on bullhead Change-Id: I28cc356e216a3e957b5533c338ee6bc3c0920222
* Const modifiersMikhail Lappo2017-03-231-1/+1
| | | | | | | | This functions do not change class variables Would be good to mark them as const, so class variables are not changed by coincidence Change-Id: Iea34f6d26dbd1bde813035160e07ff2a681989e6
* Remove ota_close(int) and ota_fclose(FILE*).Tao Bao2016-11-281-6/+14
| | | | | | | | | | | We should always use unique_fd or unique_file to hold the FD or FILE* pointer when opening via ota_(f)open functions. This CL avoids accidentally closing raw FDs or FILE* pointers that are managed by unique_fd/unique_file. Test: recovery_component_test passes. Change-Id: If58eb8b5c5da507563f85efd5d56276472a1c957
* Add ota_close(unique_fd&) and ota_fclose(std::unique_ptr<FILE>&).Tao Bao2016-11-231-2/+12
| | | | | | | | | | | | | | | | | | | | | | We were using the below sequence prior to the CL in [1]. unique_fd fd(ota_open(...)); ota_close(fd); fd.reset(ota_open(...)); fd.reset() may unintentionally close the newly opened FD if it has the same value as the early ota_open. The CL in [1] changed to "ota_close(fd.release())" to avoid the issue. This CL adds a new overloaded function ota_close(unique_fd&) to handle the release automatically. Similarly add ota_fclose(std::unique_ptr<FILE>&). [1] commit 48cf770471ef53fbf0a1837196220862a0bdb18d. Bug: 33034669 Test: recovery_component_test passes. Change-Id: Ief91edc590e95a7426e33364b28754173efb1056
* Merge \"Fix clang-tidy performance warnings.\"Chih-Hung Hsieh2016-07-271-1/+1
|\ | | | | | | | | | | am: 2a3b695168 Change-Id: I55cadf517ec612f1b03de71ce7ca5cff69bc80d0
| * Fix clang-tidy performance warnings.Chih-Hung Hsieh2016-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | * Use const reference parameter type to avoid unnecessary copy. * Use more efficient overloaded string methods. Bug: 30407689 Bug: 30411878 Change-Id: Iefab05c077367f272abf545036b853e8a295c8cd Test: build with WITH_TIDY=1
* | Control fault injection with config files instead of build flagsJed Estep2016-03-211-103/+71
|\ \ | | | | | | | | | | | | | | | | | | am: ff6df89 * commit 'ff6df890a2a01bf3bf56d3f430b17a5ef69055cf': Control fault injection with config files instead of build flags
| * | Control fault injection with config files instead of build flagsJed Estep2016-03-191-103/+71
| | | | | | | | | | | | | | | Bug: 27724259 Change-Id: I65bdefed10b3fb85fcb9e1147eaf0687d7d438f4
* | | resolve merge conflicts of ce58688 to nyc-dev-plus-aospTao Bao2016-03-171-71/+104
|\| | | |/ |/| | | Change-Id: Ia9bfb989b6d13ee4f6a22216beb94065a9487484
| * Revert "DO NOT MERGE Control fault injection with config files instead of build flags"Tao Bao2016-03-171-71/+103
| | | | | | | | | | | | | | This reverts commit f73abf36bcfd433a3fdd1664a77e8e531346c1b1. Bug: 27724259 Change-Id: I1301fdad15650837d0b1febd0c3239134e2b94fb
| * DO NOT MERGE Control fault injection with config files instead of build flagsJed Estep2016-03-161-103/+71
| | | | | | | | | | Bug: 26570379 Change-Id: I76109d09276d6e3ed3a32b6fedafb2582f545c0c
| * otafault: Fix setting of have_eio_error.Greg Kaiser2016-03-141-1/+1
| | | | | | | | | | | | | | | | There was one case (ota_fsync, under TARGET_SYNC_FAULT, when the filename was cached) where we were not setting have_eio_error prior to returning. We fix that. Change-Id: I2b0aa61fb1e821f0e77881aba04db95cd8396812
| * Reboot and retry on I/O errorsTianjie Xu2016-03-101-10/+58
| | | | | | | | | | | | | | | | | | When I/O error happens, reboot and retry installation two times before we abort this OTA update. Bug: 25633753 Change-Id: Iba6d4203a343a725aa625a41d237606980d62f69 (cherry picked from commit 3c62b67faf8a25f1dd1c44dc19759c3997fdfd36)
| * IO fault injection for OTA packagesJed Estep2016-01-061-0/+160
| | | | | Bug: 25951086 Change-Id: I31c74c735eb7a975b7f41fe2b2eff042e5699c0c
* Reboot and retry on I/O errorsTianjie Xu2016-03-031-5/+32
| | | | | | | | When I/O error happens, reboot and retry installation two times before we abort this OTA update. Bug: 25633753 Change-Id: Iba6d4203a343a725aa625a41d237606980d62f69
* Control fault injection with config files instead of build flagsJed Estep2016-02-231-87/+76
| | | | | | Bug: 26570379 Change-Id: I76109d09276d6e3ed3a32b6fedafb2582f545c0c (cherry picked from commit d940887dde23597dc358b16d96ca48dd7480fee6)
* IO fault injection for OTA packagesJed Estep2016-02-101-0/+160
Bug: 25951086 Change-Id: I31c74c735eb7a975b7f41fe2b2eff042e5699c0c (cherry-picked from commit f1fc48c6e62cfee42d25ad12f443e22d50c15d0b)