diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2025-10-20 22:07:49 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2025-10-21 23:15:29 +0200 |
| commit | e0a0365383a3baf1a13b68c476421a85d29a244b (patch) | |
| tree | 6f04e9f9a1d17edc476835e045e656833b419f00 /src/unique_pipe.cc | |
| parent | aa1c7942422ce96ce8a47830ec78687932766a73 (diff) | |
signals: Replace pipe with eventfd
Simplify code.
Diffstat (limited to 'src/unique_pipe.cc')
| -rw-r--r-- | src/unique_pipe.cc | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/unique_pipe.cc b/src/unique_pipe.cc deleted file mode 100644 index 28c106d..0000000 --- a/src/unique_pipe.cc +++ /dev/null @@ -1,32 +0,0 @@ -#include "unique_pipe.hh" - -#include <unistd.h> -#include <utility> - -unique_pipe::unique_pipe() { - int fd[2]; - if (pipe(fd)) - return; - fd_[0] = unique_fd(fd[0]); - fd_[1] = unique_fd(fd[1]); -} - -unique_pipe::unique_pipe(unique_pipe&& fd) { - fd_[0] = unique_fd(fd.fd_[0].release()); - fd_[1] = unique_fd(fd.fd_[1].release()); -} - -unique_pipe& unique_pipe::operator=(unique_pipe&& fd) { - fd_[0].reset(fd.fd_[0].release()); - fd_[1].reset(fd.fd_[1].release()); - return *this; -} - -void unique_pipe::reset() { - fd_[0].reset(); - fd_[1].reset(); -} - -unique_fd unique_pipe::release_reader() { return std::move(fd_[0]); } - -unique_fd unique_pipe::release_writer() { return std::move(fd_[1]); } |
