Date: Sat, 22 Oct 2016 20:50:49 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307792 - stable/11/lib/libdevdctl Message-ID: <201610222050.u9MKonf8011564@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Sat Oct 22 20:50:49 2016 New Revision: 307792 URL: https://svnweb.freebsd.org/changeset/base/307792 Log: MFC r307364: directly create the socket with SOCK_NONBLOCK instead of calling fcntl(2) Modified: stable/11/lib/libdevdctl/consumer.cc Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libdevdctl/consumer.cc ============================================================================== --- stable/11/lib/libdevdctl/consumer.cc Sat Oct 22 20:49:44 2016 (r307791) +++ stable/11/lib/libdevdctl/consumer.cc Sat Oct 22 20:50:49 2016 (r307792) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610222050.u9MKonf8011564>