Author: bapt
Date: Sat Oct 15 13:16:52 2016
New Revision: 307364
URL: https://svnweb.freebsd.org/changeset/base/307364

Log:
  directly create the socket with SOCK_NONBLOCK instead of calling fcntl(2)

Modified:
  head/lib/libdevdctl/consumer.cc

Modified: head/lib/libdevdctl/consumer.cc
==============================================================================
--- head/lib/libdevdctl/consumer.cc     Sat Oct 15 12:42:47 2016        
(r307363)
+++ head/lib/libdevdctl/consumer.cc     Sat Oct 15 13:16:52 2016        
(r307364)
@@ -108,11 +108,9 @@ Consumer::ConnectToDevd()
        strlcpy(devdAddr.sun_path, s_devdSockPath, sizeof(devdAddr.sun_path));
        sLen = SUN_LEN(&devdAddr);
 
-       m_devdSockFD = socket(AF_UNIX, SOCK_SEQPACKET, 0);
+       m_devdSockFD = socket(AF_UNIX, SOCK_SEQPACKET | SOCK_NONBLOCK, 0);
        if (m_devdSockFD == -1)
                err(1, "Unable to create socket");
-        if (fcntl(m_devdSockFD, F_SETFL, O_NONBLOCK) < 0)
-                err(1, "fcntl");
        result = connect(m_devdSockFD,
                         reinterpret_cast<sockaddr *>(&devdAddr),
                         sLen);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to