From 5951a560afd9ea4210301d206a41e701d9b6f5ad Mon Sep 17 00:00:00 2001 From: angt Date: Sun, 1 Nov 2015 19:16:51 +0100 Subject: [PATCH] Be nice with the CPU in fd_{read,write}_all() --- glorytun.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/glorytun.c b/glorytun.c index b7b6df1..4f63552 100644 --- a/glorytun.c +++ b/glorytun.c @@ -263,7 +263,14 @@ static ssize_t fd_read_all (int fd, void *data, size_t size) { size_t done = 0; + struct pollfd pollfd = { + .fd = fd, + .events = POLLIN, + }; + while (done