summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHirokazu Honda <hiroh@chromium.org>2021-06-10 16:50:18 +0900
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-12-03 19:20:44 +0200
commit1d0dbc0da83968d9b2f21b9552151ca28fd392e5 (patch)
treed49181a562c2ad984a7b55c39c6d3885f3a85a72 /include
parent779f70c7473bc1d6575f9f0e9f49b299e39c9585 (diff)
libcamera: base: file_descriptor: Add constructor from UniqueFD
Add a FileDescriptor constructor that takes a UniqueFD, transfering ownership of the file descriptor to the FileDescriptor. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/base/file_descriptor.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/libcamera/base/file_descriptor.h b/include/libcamera/base/file_descriptor.h
index 5d1594e8..74292eba 100644
--- a/include/libcamera/base/file_descriptor.h
+++ b/include/libcamera/base/file_descriptor.h
@@ -11,11 +11,14 @@
namespace libcamera {
+class UniqueFD;
+
class FileDescriptor final
{
public:
explicit FileDescriptor(const int &fd = -1);
explicit FileDescriptor(int &&fd);
+ explicit FileDescriptor(UniqueFD fd);
FileDescriptor(const FileDescriptor &other);
FileDescriptor(FileDescriptor &&other);
~FileDescriptor();