util: Remove descriptor
No longer referenced by the code.
Change-Id: Ia604bb72c91edfa7cf187b4fc620689b62b8a08f
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/src/util.hpp b/src/util.hpp
index c463ce0..fd00b31 100644
--- a/src/util.hpp
+++ b/src/util.hpp
@@ -194,56 +194,4 @@
} // namespace network
-class Descriptor
-{
- private:
- /** default value */
- int fd = -1;
-
- public:
- Descriptor() = default;
- Descriptor(const Descriptor&) = delete;
- Descriptor& operator=(const Descriptor&) = delete;
- Descriptor(Descriptor&&) = delete;
- Descriptor& operator=(Descriptor&&) = delete;
-
- explicit Descriptor(int fd) : fd(fd)
- {
- }
-
- /* @brief sets the internal file descriptor with the given descriptor
- * and closes the old descriptor.
- * @param[in] descriptor - File/Socket descriptor.
- */
- void set(int descriptor)
- {
- // same descriptor given
- if (fd == descriptor)
- {
- return;
- }
-
- // close the old descriptor
- if (fd >= 0)
- {
- close(fd);
- }
-
- fd = descriptor;
- }
-
- ~Descriptor()
- {
- if (fd >= 0)
- {
- close(fd);
- }
- }
-
- int operator()() const
- {
- return fd;
- }
-};
-
} // namespace phosphor