message: Add constructor with an int parameter for unix_fd
This allows implicit conversions from int to unix_fd. This is for
instance useful in functions where one wants to return an unix_fd by
just supplying the actual int file descriptor.
Change-Id: I118b8ec6b5a3d1533f5b05177127c28ad2539f3d
Signed-off-by: Waqar Hameed <waqarh@axis.com>
diff --git a/sdbusplus/message/native_types.hpp b/sdbusplus/message/native_types.hpp
index efa0d3f..ace33be 100644
--- a/sdbusplus/message/native_types.hpp
+++ b/sdbusplus/message/native_types.hpp
@@ -85,6 +85,11 @@
{
int fd;
+ unix_fd_type() = default;
+ unix_fd_type(int f) : fd(f)
+ {
+ }
+
operator int() const
{
return fd;