diff --git a/src/fd_control.c b/src/fd_control.c
index b139da5884a355126bd846fea33b5983e0eb5d1d..4c6f38ab81c36edaabacecbe92509406b85236cc 100644
--- a/src/fd_control.c
+++ b/src/fd_control.c
@@ -3,11 +3,6 @@
 ||| Pike is distributed as GPL (General Public License)
 ||| See the files COPYING and DISCLAIMER for more information.
 \*/
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include "fd_control.h"
-
 #ifndef TESTING
 #include "global.h"
 #include "error.h"
@@ -15,6 +10,11 @@
 #undef DEBUG
 #endif
 
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include "fd_control.h"
+
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #endif