rtnetlink: Switch to stdplus::Fd
Simplifies the code a little bit and will allow us to remove the
Descriptor.
Change-Id: If78ea4478fed9f818bcf1d00ef1c952cb5c7df00
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/src/network_manager_main.cpp b/src/network_manager_main.cpp
index 802b7d6..b72e32d 100644
--- a/src/network_manager_main.cpp
+++ b/src/network_manager_main.cpp
@@ -265,19 +265,6 @@
} // namespace network
} // namespace phosphor
-void createNetLinkSocket(phosphor::Descriptor& smartSock)
-{
- // RtnetLink socket
- auto fd = socket(PF_NETLINK, SOCK_RAW | SOCK_NONBLOCK, NETLINK_ROUTE);
- if (fd < 0)
- {
- log<level::ERR>("Unable to create the net link socket",
- entry("ERRNO=%d", errno));
- elog<InternalFailure>();
- }
- smartSock.set(fd);
-}
-
int main(int /*argc*/, char** /*argv*/)
{
phosphor::network::initializeTimers();
@@ -315,12 +302,8 @@
phosphor::network::manager->reloadConfigs();
}
- // RtnetLink socket
- phosphor::Descriptor smartSock;
- createNetLinkSocket(smartSock);
-
// RTNETLINK event handler
- phosphor::network::rtnetlink::Server svr(eventPtr, smartSock);
+ phosphor::network::rtnetlink::Server svr(eventPtr);
#ifdef SYNC_MAC_FROM_INVENTORY
std::ifstream in(configFile);