From 6ff56d79d5efd95a064a475f0f7043bd54a66d33 Mon Sep 17 00:00:00 2001 From: Miguel Flores Ruiz de Eguino <1889916+miguelfrde@users.noreply.github.com> Date: Thu, 2 Jan 2020 11:04:02 -0800 Subject: [PATCH] [fuchsia] Add diagnostics directory to the remote dirs and ensure entry exists This reverts commit 4312d37eb1cdd0ed2e7b44647c7156499b741ac7. Once https://fuchsia-review.googlesource.com/c/topaz/+/351729 lands, the diagnostics directory will be present, this would be safe to do and the roller won't be blocked again. --- shell/platform/fuchsia/flutter/component.cc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/shell/platform/fuchsia/flutter/component.cc b/shell/platform/fuchsia/flutter/component.cc index deb12123624f2..fd96d36a2d88b 100644 --- a/shell/platform/fuchsia/flutter/component.cc +++ b/shell/platform/fuchsia/flutter/component.cc @@ -233,15 +233,21 @@ Application::Application( << "): " << zx_status_get_string(status); return; } - const char* other_dirs[] = {"debug", "ctrl"}; + const char* other_dirs[] = {"debug", "ctrl", "diagnostics"}; // add other directories as RemoteDirs. for (auto& dir_str : other_dirs) { fidl::InterfaceHandle dir; auto request = dir.NewRequest().TakeChannel(); - fdio_service_connect_at(directory_ptr_.channel().get(), dir_str, - request.release()); - outgoing_dir_->AddEntry( - dir_str, std::make_unique(dir.TakeChannel())); + auto status = fdio_service_connect_at(directory_ptr_.channel().get(), + dir_str, request.release()); + if (status == ZX_OK) { + outgoing_dir_->AddEntry( + dir_str, std::make_unique(dir.TakeChannel())); + } else { + FML_LOG(ERROR) << "could not add out directory entry(" << dir_str + << ") for flutter app(" << debug_label_ + << "): " << zx_status_get_string(status); + } } };