diff options
Diffstat (limited to 'base/include/android-base/unique_fd.h')
-rw-r--r-- | base/include/android-base/unique_fd.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/base/include/android-base/unique_fd.h b/base/include/android-base/unique_fd.h index 057f462e5..019d337c4 100644 --- a/base/include/android-base/unique_fd.h +++ b/base/include/android-base/unique_fd.h | |||
@@ -151,7 +151,8 @@ using unique_fd = unique_fd_impl<DefaultCloser>; | |||
151 | #if !defined(_WIN32) | 151 | #if !defined(_WIN32) |
152 | 152 | ||
153 | // Inline functions, so that they can be used header-only. | 153 | // Inline functions, so that they can be used header-only. |
154 | inline bool Pipe(unique_fd* read, unique_fd* write) { | 154 | template <typename Closer> |
155 | inline bool Pipe(unique_fd_impl<Closer>* read, unique_fd_impl<Closer>* write) { | ||
155 | int pipefd[2]; | 156 | int pipefd[2]; |
156 | 157 | ||
157 | #if defined(__linux__) | 158 | #if defined(__linux__) |
@@ -175,7 +176,9 @@ inline bool Pipe(unique_fd* read, unique_fd* write) { | |||
175 | return true; | 176 | return true; |
176 | } | 177 | } |
177 | 178 | ||
178 | inline bool Socketpair(int domain, int type, int protocol, unique_fd* left, unique_fd* right) { | 179 | template <typename Closer> |
180 | inline bool Socketpair(int domain, int type, int protocol, unique_fd_impl<Closer>* left, | ||
181 | unique_fd_impl<Closer>* right) { | ||
179 | int sockfd[2]; | 182 | int sockfd[2]; |
180 | if (socketpair(domain, type, protocol, sockfd) != 0) { | 183 | if (socketpair(domain, type, protocol, sockfd) != 0) { |
181 | return false; | 184 | return false; |
@@ -185,7 +188,8 @@ inline bool Socketpair(int domain, int type, int protocol, unique_fd* left, uniq | |||
185 | return true; | 188 | return true; |
186 | } | 189 | } |
187 | 190 | ||
188 | inline bool Socketpair(int type, unique_fd* left, unique_fd* right) { | 191 | template <typename Closer> |
192 | inline bool Socketpair(int type, unique_fd_impl<Closer>* left, unique_fd_impl<Closer>* right) { | ||
189 | return Socketpair(AF_UNIX, type, 0, left, right); | 193 | return Socketpair(AF_UNIX, type, 0, left, right); |
190 | } | 194 | } |
191 | 195 | ||