[fuchsia] Print error on failing fdio_ns_destroy instead of crashing.

Makes debug mode more useful.

Change-Id: Iccdb1be03d4abe23424cfb993c566fecb3d74ced
Reviewed-on: https://dart-review.googlesource.com/52021
Reviewed-by: Zach Anderson <zra@google.com>
This commit is contained in:
Ryan Macnak 2018-04-19 22:53:13 +00:00
parent ffc1f607a1
commit 66e66daf86

View file

@ -11,6 +11,7 @@
#include <fcntl.h>
#include <fdio/namespace.h>
#include <fdio/private.h>
#include <zircon/status.h>
#include "bin/file.h"
#include "platform/signal_blocker.h"
@ -42,7 +43,9 @@ class NamespaceImpl {
~NamespaceImpl() {
if (fdio_ns_ != NULL) {
zx_status_t status = fdio_ns_destroy(fdio_ns_);
ASSERT(status == ZX_OK);
if (status != ZX_OK) {
Log::PrintErr("fdio_ns_destroy: %s\n", zx_status_get_string(status));
}
}
NO_RETRY_EXPECTED(close(rootfd_));
free(cwd_);