summaryrefslogtreecommitdiffstats
path: root/src/fastd.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-04-30 03:32:36 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-04-30 03:32:36 +0200
commit0d0a857c696b653a65c709bbfb11bdaff67369b8 (patch)
treee1c26da2053f8b4801b5120517b16838b7a66c32 /src/fastd.h
parent4f082c7df3998cdc2cdf9845a62d886d05257cb8 (diff)
downloadfastd-0d0a857c696b653a65c709bbfb11bdaff67369b8.tar
fastd-0d0a857c696b653a65c709bbfb11bdaff67369b8.zip
Use SOCK_NONBLOCK where available
Diffstat (limited to 'src/fastd.h')
-rw-r--r--src/fastd.h4
1 files changed, 2 insertions, 2 deletions
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");
}