From: Ben Pfaff Date: Fri, 3 Oct 2008 22:10:31 +0000 (-0700) Subject: Add explanatory comment to make_unix_socket(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1374258f0ae5beccd71a62f710dce263922f6dc3;p=openvswitch Add explanatory comment to make_unix_socket(). --- diff --git a/lib/socket-util.c b/lib/socket-util.c index ca08de5a..7d54a481 100644 --- a/lib/socket-util.c +++ b/lib/socket-util.c @@ -201,6 +201,10 @@ make_unix_socket(int style, bool nonblock, bool passcred UNUSED, return -errno; } + /* Set nonblocking mode right away, if we want it. This prevents blocking + * in connect(), if connect_path != NULL. (In turn, that's a corner case: + * it will only happen if style is SOCK_STREAM or SOCK_SEQPACKET, and only + * if a backlog of un-accepted connections has built up in the kernel.) */ if (nonblock) { int flags = fcntl(fd, F_GETFL, 0); if (flags == -1) {