io: add io_fd_block() helper.
[ccan] / ccan / io / benchmarks / run-different-speed.c
index 5ee15ea6d0235ce929b0e171db24e4c8eb977a1e..c540f48d3a12744317a6316a8acbc6e7c76a1f5f 100644 (file)
@@ -60,7 +60,7 @@ static void create_clients(struct sockaddr_un *addr, int waitfd)
                if (connect(sock[i], (void *)addr, sizeof(*addr)) != 0)
                        err(1, "connecting socket");
                /* Make nonblocking. */
-               fcntl(sock[i], F_SETFD, fcntl(sock[i], F_GETFD)|O_NONBLOCK);
+               io_fd_block(sock[i], false);
                done[i] = 0;
        }