Index: libs/libmythdb/mythsocketthread.cpp
===================================================================
--- libs/libmythdb/mythsocketthread.cpp	(revision 21591)
+++ libs/libmythdb/mythsocketthread.cpp	(working copy)
@@ -3,17 +3,16 @@
 #include <cassert>
 
 // POSIX
+#ifdef USING_MINGW 
+#include <winsock2.h>   // for select
+#else 
 #include <sys/select.h> // for select
+#endif 
 #include <sys/types.h>  // for fnctl
 #include <unistd.h>     // for fnctl & other
 #include <fcntl.h>      // for fnctl
 #include <errno.h>      // for checking errno
 
-// Microsoft
-#ifdef USING_MINGW
-#include <winsock2.h>
-#endif
-
 // MythTV
 #include "mythsocketthread.h"
 #include "mythsocket.h"
@@ -157,9 +156,7 @@
 {
     VERBOSE(VB_SOCKET, "MythSocketThread: readyread thread start");
 
-    fd_set rfds;
     MythSocket *sock;
-    int maxfd;
     bool found;
 
     while (m_readyread_run)
@@ -273,6 +270,9 @@
 
 #else /* if !USING_MINGW */
 
+        fd_set rfds;
+        int maxfd;
+
         // add check for bad fd?
         FD_ZERO(&rfds);
         maxfd = m_readyread_pipe[0];
