commit | 730646199b8de879621e97d3196d49f8b71afdda | [log] [tgz] |
---|---|---|
author | Tao Bao <tbao@google.com> | Tue Apr 26 17:14:32 2016 -0700 |
committer | Tao Bao <tbao@google.com> | Tue Apr 26 17:36:13 2016 -0700 |
tree | e738ad4e5cd08fe68d66b29b57efa9e9f42270e4 | |
parent | a1f4a1ec3319ee1ab869a46805bff63550b56ca7 [diff] |
updater: Don't zero out CommandParameters with memset(3). [1] switched a few things to android::base::unique_fd including CommandParameters.fd. However, we were using memset(3) to zero out the struct, which effectively assigned unique_fd(0) to fd. When it called fd.reset(), file descriptor 0 was unintentionally closed. When FD 0 was later reassigned via open(2), it led to lseek(2) errors: "Bad file descriptor". This CL switches to using braced-init (i.e. '= {}') instead, so that the default constructor unique_fd(-1) would be called. [1]: commit bcabd0929316fdd022ea102cc86396547ad9f070 Bug: 28391985 Change-Id: If1f99932b15552714c399e65c8b80550344b758a
mm -j && m ramdisk-nodeps && m recoveryimage-nodeps # To boot into the new recovery image # without flashing the recovery partition: adb reboot bootloader fastboot boot $ANDROID_PRODUCT_OUT/recovery.img
# After setting up environment and lunch. mmma -j bootable/recovery # Running the tests on device. adb root adb sync data # 32-bit device adb shell /data/nativetest/recovery_unit_test/recovery_unit_test adb shell /data/nativetest/recovery_component_test/recovery_component_test # Or 64-bit device adb shell /data/nativetest64/recovery_unit_test/recovery_unit_test adb shell /data/nativetest64/recovery_component_test/recovery_component_test