]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Unify the conflicting FDWrapper from rec and dnsdist
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 30 Aug 2021 15:39:19 +0000 (17:39 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 13 Sep 2021 13:28:28 +0000 (15:28 +0200)
pdns/misc.hh
pdns/rec_channel_rec.cc

index 5eefe8054a47e869c97117e5bb7064ce644adb8f..3c54329e0ee3d81f9fe0ae58b04a5fbf59c7b26f 100644 (file)
@@ -674,6 +674,11 @@ struct FDWrapper
     return d_fd;
   }
 
+  operator int() const
+  {
+    return d_fd;
+  }
+
 private:
   int d_fd{-1};
 };
index 360b1f54c89b4bcdb599b474af3614eec2392dae..90dd8d92806ced3d4a03a2167bc3415585acf23a 100644 (file)
@@ -273,28 +273,6 @@ string static doGetParameter(T begin, T end)
   return ret;
 }
 
-struct FDWrapper : public boost::noncopyable
-{
-  FDWrapper(int descr) : fd(descr) {}
-  ~FDWrapper()
-  {
-    if (fd != -1) {
-      close(fd);
-    }
-    fd = -1;
-  }
-  FDWrapper(FDWrapper&& rhs) : fd(rhs.fd)
-  {
-    rhs.fd = -1;
-  }
-  operator int() const
-  {
-    return fd;
-  }
-private:
-  int fd;
-};
-
 /* Read an (open) fd from the control channel */
 static FDWrapper
 getfd(int s)