From 0d0a857c696b653a65c709bbfb11bdaff67369b8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 30 Apr 2014 03:32:36 +0200 Subject: Use SOCK_NONBLOCK where available --- src/fastd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/fastd.h') diff --git a/src/fastd.h b/src/fastd.h index b5dbe0c..3bb4689 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -331,12 +331,12 @@ static inline int fastd_rand(int min, int max) { } -static inline void fastd_setfl(const int fd, int set) { +static inline void fastd_setnonblock(int fd) { int flags = fcntl(fd, F_GETFL); if (flags < 0) exit_errno("Getting file status flags failed: fcntl"); - if (fcntl(fd, F_SETFL, flags|set) < 0) + if (fcntl(fd, F_SETFL, flags|O_NONBLOCK) < 0) exit_errno("Setting file status flags failed: fcntl"); } -- cgit v1.2.3