From 798d3aac5afb41e0e08b0e5011d4f85764ac2b86 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 29 Aug 2016 16:16:51 +1000 Subject: [PATCH] io: add dup instance method to fd --- io.cpp | 8 ++++++++ io.hpp | 1 + 2 files changed, 9 insertions(+) diff --git a/io.cpp b/io.cpp index 0629e988..67e1721f 100644 --- a/io.cpp +++ b/io.cpp @@ -166,6 +166,14 @@ fd::~fd () { } +/////////////////////////////////////////////////////////////////////////////// +fd +fd::dup (void) const +{ + return dup (m_fd); +} + + //----------------------------------------------------------------------------- fd fd::dup (int _fd) diff --git a/io.hpp b/io.hpp index 37a7ce35..8e109fc6 100644 --- a/io.hpp +++ b/io.hpp @@ -47,6 +47,7 @@ namespace util { fd (const char *path, int flags, mode_t mode = 0660); fd (const boost::filesystem::path&, int flags); + fd dup (void) const; static fd dup (int); ~fd ();