Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c91e090 authored by Josh Gao's avatar Josh Gao Committed by android-build-merger
Browse files

Merge "base: disallow close() on unique_fd." am: ca82aa7d

am: 8c23285a

Change-Id: Ib0a048c6792e90b8a61f4b18a50eb868f0dd671f
parents 9b1015d4 8c23285a
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -95,4 +95,14 @@ using unique_fd = unique_fd_impl<DefaultCloser>;
}  // namespace base
}  // namespace android

template <typename T>
int close(const android::base::unique_fd_impl<T>&)
#if defined(__clang__)
  __attribute__((__unavailable__(
#else
  __attribute__((__error__(
#endif
    "close called on unique_fd"
  )));

#endif  // ANDROID_BASE_UNIQUE_FD_H