summaryrefslogtreecommitdiffstats
path: root/otafault/ota_io.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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-8/+8
| | | | | | | | | | | 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-0/+6
| | | | | | | | | | | | | | | | | | | | | | 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
* applypatch: Use unique_fd to avoid leaking FDs.Tao Bao2016-11-171-0/+10
| | | | | | | | | Add unique_fd that calls ota_close() instead of the default closer. Test: recovery_component_test passes. Test: Apply a package that calls apply_patch(). Change-Id: I0c19921731757934f76cf7d5215916673a8f2777
* Control fault injection with config files instead of build flagsJed Estep2016-03-191-0/+4
| | | | | Bug: 27724259 Change-Id: I65bdefed10b3fb85fcb9e1147eaf0687d7d438f4
* Revert "DO NOT MERGE Control fault injection with config files instead of build flags"Tao Bao2016-03-171-4/+0
| | | | | | | 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-0/+4
| | | | | Bug: 26570379 Change-Id: I76109d09276d6e3ed3a32b6fedafb2582f545c0c
* IO fault injection for OTA packagesJed Estep2016-01-061-0/+49
Bug: 25951086 Change-Id: I31c74c735eb7a975b7f41fe2b2eff042e5699c0c