From 74062589d79ad7019c7c659ce7a3362629f543f1 Mon Sep 17 00:00:00 2001
From: Benny Baumann <BenBE@geshi.org>
Date: Sun, 3 Jan 2021 16:19:57 +0100
Subject: [PATCH] add: Allow for fd validity check directly in auto_fd object

---
 src/net/async_fd.hpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/net/async_fd.hpp b/src/net/async_fd.hpp
index b5a837a..b5a7f0d 100644
--- a/src/net/async_fd.hpp
+++ b/src/net/async_fd.hpp
@@ -64,6 +64,10 @@ namespace rmrf::net {
             _fd = fd;
         }
 
+        inline bool valid() const {
+            return _fd >= 0;
+        }
+
     };
 
     inline bool operator==(const auto_fd &x, const auto_fd &y) {
-- 
GitLab