aboutsummaryrefslogtreecommitdiff
path: root/libbutl
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-11-09 14:42:46 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-11-09 21:43:53 +0300
commit8ecdfc2e77068b357971fb85ffa9837140d13834 (patch)
tree2039452943ce4c696365f47dbe0b0e2c2739e443 /libbutl
parent970e678f8a2266088f8610a2057111d211b943c1 (diff)
Add data member to fdselect_state
Diffstat (limited to 'libbutl')
-rw-r--r--libbutl/fdstream.hxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/libbutl/fdstream.hxx b/libbutl/fdstream.hxx
index 1a8f9a6..59cf2ff 100644
--- a/libbutl/fdstream.hxx
+++ b/libbutl/fdstream.hxx
@@ -914,11 +914,13 @@ namespace butl
{
int fd;
bool ready;
+ void* data; // Arbitrary data which can be associated with the descriptor.
// Note: intentionally non-explicit to allow implicit initialization when
// pushing to fdselect_set.
//
- fdselect_state (int fd): fd (fd), ready (false) {}
+ fdselect_state (int fd, void* d = nullptr)
+ : fd (fd), ready (false), data (d) {}
};
using fdselect_set = small_vector<fdselect_state, 4>;