diff options
author | Chun-Wei Wang <wangchun@google.com> | 2023-11-14 06:18:49 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2023-11-14 06:18:49 +0000 |
commit | d2951755f4a433b2cff48ce44e8c539af3d6f75d (patch) | |
tree | bf1b2f9aade88a6419b8d3602b6874b656381412 | |
parent | 30c1fa1593fe1b69c3d5d3cf3fba4a3c62bbc229 (diff) | |
parent | 957c61a22b07d78f43beeaa60d123f72f5f8aeb5 (diff) | |
download | gsid-d2951755f4a433b2cff48ce44e8c539af3d6f75d.tar.gz |
Merge "Revert "Check for null system device"" into main
-rw-r--r-- | gsi_service.cpp | 6 | ||||
-rw-r--r-- | partition_installer.cpp | 11 |
2 files changed, 1 insertions, 16 deletions
diff --git a/gsi_service.cpp b/gsi_service.cpp index 113fb11..18e97ff 100644 --- a/gsi_service.cpp +++ b/gsi_service.cpp @@ -505,12 +505,6 @@ binder::Status GsiService::getAvbPublicKey(AvbPublicKey* dst, int32_t* _aidl_ret return binder::Status::ok(); } int fd = installer_->GetPartitionFd(); - if (fd == -1) { - *_aidl_return = INSTALL_ERROR_GENERIC; - return binder::Status::fromExceptionCode(binder::Status::EX_ILLEGAL_STATE, - "Failed to get valid partition fd"); - } - if (!GetAvbPublicKeyFromFd(fd, dst)) { LOG(ERROR) << "Failed to extract AVB public key"; *_aidl_return = INSTALL_ERROR_GENERIC; diff --git a/partition_installer.cpp b/partition_installer.cpp index 126d50d..ebd3b64 100644 --- a/partition_installer.cpp +++ b/partition_installer.cpp @@ -256,9 +256,6 @@ bool PartitionInstaller::CommitGsiChunk(const void* data, size_t bytes) { } int PartitionInstaller::GetPartitionFd() { - if (!system_device_) { - return -1; - } return system_device_->fd(); } @@ -316,13 +313,7 @@ int PartitionInstaller::CheckInstallState() { << (size_ - gsi_bytes_written_) << " bytes"; return IGsiService::INSTALL_ERROR_GENERIC; } - int fd = GetPartitionFd(); - if (fd == -1) { - PLOG(ERROR) << "Failed to get partition fd"; - return IGsiService::INSTALL_ERROR_GENERIC; - } - - if (system_device_ != nullptr && fsync(fd)) { + if (system_device_ != nullptr && fsync(GetPartitionFd())) { PLOG(ERROR) << "fsync failed for " << GetBackingFile(name_); return IGsiService::INSTALL_ERROR_GENERIC; } |