summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2016-10-22 20:49:44 +0000
committerbapt <bapt@FreeBSD.org>2016-10-22 20:49:44 +0000
commitae634620f39dacd4d81adf6de340d10768719b34 (patch)
treee2ef38d9dd43f989ebd36ace5011a00a9c572676 /usr.sbin
parentffafe3ab704ae77aebac04aed2a2f970475312d8 (diff)
downloadFreeBSD-src-ae634620f39dacd4d81adf6de340d10768719b34.zip
FreeBSD-src-ae634620f39dacd4d81adf6de340d10768719b34.tar.gz
MFC r306554:
Use accept4 with O_NONBLOCK rather than accept + fcntl
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bhyve/dbgport.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.sbin/bhyve/dbgport.c b/usr.sbin/bhyve/dbgport.c
index 5be0ceb..6e6c83f 100644
--- a/usr.sbin/bhyve/dbgport.c
+++ b/usr.sbin/bhyve/dbgport.c
@@ -73,10 +73,8 @@ again:
printf("Waiting for connection from gdb\r\n");
printonce = 1;
}
- conn_fd = accept(listen_fd, NULL, NULL);
- if (conn_fd >= 0)
- fcntl(conn_fd, F_SETFL, O_NONBLOCK);
- else if (errno != EINTR)
+ conn_fd = accept4(listen_fd, NULL, NULL, O_NONBLOCK);
+ if (conn_fd < 0 && errno != EINTR)
perror("accept");
}
OpenPOWER on IntegriCloud