aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2013-02-01 14:54:15 -0800
committerBen Pfaff <blp@nicira.com>2013-02-01 14:54:15 -0800
commitb36db1148939c1ca7af3c3973252fea3fbf1c4e6 (patch)
treecbdc6811e55c576714dc8649d7488cf591523129 /lib
parent75b0b752d8d70edcd08f18e1028d60537cdede85 (diff)
socket-util: Use set_nonblocking() helper function.
There's no reason to inline this when we have a helper for it. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/socket-util.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/socket-util.c b/lib/socket-util.c
index 3e3c67fe..9fea7bda 100644
--- a/lib/socket-util.c
+++ b/lib/socket-util.c
@@ -409,13 +409,8 @@ make_unix_socket(int style, bool nonblock,
* 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) {
- error = errno;
- goto error;
- }
- if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1) {
- error = errno;
+ error = set_nonblocking(fd);
+ if (error) {
goto error;
}
}