Loading base/include/android-base/unique_fd.h +3 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,9 @@ class unique_fd_impl final { int get() const { return fd_; } operator int() const { return get(); } // NOLINT // Catch bogus error checks (i.e.: "!fd" instead of "fd != -1"). bool operator!() const = delete; int release() __attribute__((warn_unused_result)) { tag(fd_, this, nullptr); int ret = fd_; Loading init/service.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -177,7 +177,7 @@ Result<Success> Service::SetUpPidNamespace() const { Result<Success> Service::EnterNamespaces() const { for (const auto& [nstype, path] : namespaces_to_enter_) { auto fd = unique_fd{open(path.c_str(), O_RDONLY | O_CLOEXEC)}; if (!fd) { if (fd == -1) { return ErrnoError() << "Could not open namespace at " << path; } if (setns(fd, nstype) == -1) { Loading Loading
base/include/android-base/unique_fd.h +3 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,9 @@ class unique_fd_impl final { int get() const { return fd_; } operator int() const { return get(); } // NOLINT // Catch bogus error checks (i.e.: "!fd" instead of "fd != -1"). bool operator!() const = delete; int release() __attribute__((warn_unused_result)) { tag(fd_, this, nullptr); int ret = fd_; Loading
init/service.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -177,7 +177,7 @@ Result<Success> Service::SetUpPidNamespace() const { Result<Success> Service::EnterNamespaces() const { for (const auto& [nstype, path] : namespaces_to_enter_) { auto fd = unique_fd{open(path.c_str(), O_RDONLY | O_CLOEXEC)}; if (!fd) { if (fd == -1) { return ErrnoError() << "Could not open namespace at " << path; } if (setns(fd, nstype) == -1) { Loading