summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2016-12-02 08:12:51 +0000
committerjulian <julian@FreeBSD.org>2016-12-02 08:12:51 +0000
commit3ccbb075af69079e3b7b377f577cb1e3641d23f6 (patch)
tree130c2b27b90a41e27b3c4578b6ca6eec232f9394
parentef97faaeca33de9035e50691cf976b2c9f057106 (diff)
downloadFreeBSD-src-3ccbb075af69079e3b7b377f577cb1e3641d23f6.zip
FreeBSD-src-3ccbb075af69079e3b7b377f577cb1e3641d23f6.tar.gz
MFH: r306554
Use accept4 with O_NONBLOCK rather than accept + fcntl
-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