diff --git a/src/modules/_Stdio/file.c b/src/modules/_Stdio/file.c
index 4d96618712e5ed81034c286f78cf981029be95d4..9b308399b269bb4dea733a8e5c1afd46250619d1 100644
--- a/src/modules/_Stdio/file.c
+++ b/src/modules/_Stdio/file.c
@@ -5762,7 +5762,9 @@ static void f_get_all_active_fd(INT32 args)
   pop_n_elems(args);
   sp = Pike_sp;
   {
+#ifndef __NT__
     DIR *tmp;
+#endif
     THREADS_ALLOW();
 #ifndef __NT__
     if( (tmp = opendir(