diff --git a/src/httpfetch.cpp b/src/httpfetch.cpp
index 176a3b22a057792d335da6e374f4d0ee0f201926..3d944735876234645d046de772f2881027fdc215 100644
--- a/src/httpfetch.cpp
+++ b/src/httpfetch.cpp
@@ -548,7 +548,7 @@ class CurlFetchThread : public JThread
 		if (select_timeout > 0) {
 			// in Winsock it is forbidden to pass three empty
 			// fd_sets to select(), so in that case use sleep_ms
-			if (max_fd == -1) {
+			if (max_fd != -1) {
 				select_tv.tv_sec = select_timeout / 1000;
 				select_tv.tv_usec = (select_timeout % 1000) * 1000;
 				int retval = select(max_fd + 1, &read_fd_set,