Merge "base: disallow close() on unique_fd."
am: ca82aa7d1e
Change-Id: I2caa59dad273423500da25a03dfc56592de4fafe
This commit is contained in:
commit
8c23285a85
1 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue