diff --git a/src/video/x11/SDL_x11touch.c b/src/video/x11/SDL_x11touch.c
index adc16ce04b93d170183faeb48bc3a9b629a9b70b..327648d7b66f613896ccb35cfda3d4284785f136 100644
--- a/src/video/x11/SDL_x11touch.c
+++ b/src/video/x11/SDL_x11touch.c
@@ -41,6 +41,7 @@ X11_InitTouch(_THIS)
 
   char c;
   int i = 0;
+  int tsfd;
   char line[256];
   char tstr[256];
   int vendor = -1,product = -1,event = -1;
@@ -51,7 +52,7 @@ X11_InitTouch(_THIS)
 
         sprintf(tstr,"/dev/input/event%i",event);
 
-        int tsfd = open( tstr, O_RDONLY | O_NONBLOCK );
+        tsfd = open( tstr, O_RDONLY | O_NONBLOCK );
         if ( tsfd == -1 )
             continue;   /* Maybe not enough permissions ? */