From 5b43c46b751f1c97c3c15bf8b1d447e8e7a6e527 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 29 Aug 2017 08:32:47 +0700 Subject: [PATCH] Fix naming in fd_writable --- src/file.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/file.cc b/src/file.cc index d7ff2544..24db0c04 100644 --- a/src/file.cc +++ b/src/file.cc @@ -158,12 +158,12 @@ bool fd_readable(int fd) bool fd_writable(int fd) { - fd_set rfds; - FD_ZERO(&rfds); - FD_SET(fd, &rfds); + fd_set wfds; + FD_ZERO(&wfds); + FD_SET(fd, &wfds); timeval tv{0,0}; - return select(fd+1, nullptr, &rfds, nullptr, &tv) == 1; + return select(fd+1, nullptr, &wfds, nullptr, &tv) == 1; } String read_fd(int fd, bool text)