summaryrefslogtreecommitdiffstats
path: root/lib/libdevdctl
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2016-10-22 20:50:49 +0000
committerbapt <bapt@FreeBSD.org>2016-10-22 20:50:49 +0000
commitb6e09234ba6d1982c66db77e711f338e3876bbe0 (patch)
treeee532ce7302b78cad352f37ff692d7fdb3e4089b /lib/libdevdctl
parentae634620f39dacd4d81adf6de340d10768719b34 (diff)
downloadFreeBSD-src-b6e09234ba6d1982c66db77e711f338e3876bbe0.zip
FreeBSD-src-b6e09234ba6d1982c66db77e711f338e3876bbe0.tar.gz
MFC r307364:
directly create the socket with SOCK_NONBLOCK instead of calling fcntl(2)
Diffstat (limited to 'lib/libdevdctl')
-rw-r--r--lib/libdevdctl/consumer.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/libdevdctl/consumer.cc b/lib/libdevdctl/consumer.cc
index e769894..a9949a6 100644
--- a/lib/libdevdctl/consumer.cc
+++ b/lib/libdevdctl/consumer.cc
@@ -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);
OpenPOWER on IntegriCloud