@@ -151,7 +151,8 @@ using unique_fd = unique_fd_impl<DefaultCloser>;
151
151
#if !defined(_WIN32)
152
152
153
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
156
int pipefd[2 ];
156
157
157
158
#if defined(__linux__)
@@ -175,7 +176,9 @@ inline bool Pipe(unique_fd* read, unique_fd* write) {
175
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
182
int sockfd[2 ];
180
183
if (socketpair (domain, type, protocol, sockfd) != 0 ) {
181
184
return false ;
@@ -185,7 +188,8 @@ inline bool Socketpair(int domain, int type, int protocol, unique_fd* left, uniq
185
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
193
return Socketpair (AF_UNIX, type, 0 , left, right);
190
194
}
191
195
0 commit comments