summaryrefslogtreecommitdiffstats
path: root/src/async.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-05-31 08:09:36 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-05-31 08:09:36 +0200
commitd5df5fb5b8f5e2815405a76ced4b7407988af0d6 (patch)
tree147b8cb449d956c4ace10fcac28592b5512ba13a /src/async.c
parent38dfd6da00870e5a8f1e59258f351d295599720f (diff)
downloadfastd-d5df5fb5b8f5e2815405a76ced4b7407988af0d6.tar
fastd-d5df5fb5b8f5e2815405a76ced4b7407988af0d6.zip
Fix poll race condition on *BSD
Diffstat (limited to 'src/async.c')
-rw-r--r--src/async.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/async.c b/src/async.c
index c1c4802..4a2de10 100644
--- a/src/async.c
+++ b/src/async.c
@@ -114,6 +114,9 @@ void fastd_async_handle(void) {
exit_errno("fastd_async_handle: recvmsg");
switch (header.type) {
+ case ASYNC_TYPE_NOP:
+ break;
+
case ASYNC_TYPE_RESOLVE_RETURN:
handle_resolve_return((const fastd_async_resolve_return_t *)buf);
break;
@@ -143,7 +146,7 @@ void fastd_async_enqueue(fastd_async_type_t type, const void *data, size_t len)
};
struct msghdr msg = {
.msg_iov = vec,
- .msg_iovlen = 2,
+ .msg_iovlen = len ? 2 : 1,
};
if (sendmsg(ctx.async_wfd, &msg, 0) < 0)