src/video/x11/SDL_x11touch.c
changeset 5967 ae97a61f002f
parent 5966 2edecf22a2e7
child 5968 b229328c7ad4
     1.1 --- a/src/video/x11/SDL_x11touch.c	Tue Sep 27 23:14:16 2011 -0400
     1.2 +++ b/src/video/x11/SDL_x11touch.c	Tue Sep 27 23:15:01 2011 -0400
     1.3 @@ -51,6 +51,10 @@
     1.4  
     1.5          sprintf(tstr,"/dev/input/event%i",event);
     1.6  
     1.7 +        int tsfd = open( tstr, O_RDONLY | O_NONBLOCK );
     1.8 +        if ( tsfd == -1 )
     1.9 +            continue;   /* Maybe not enough permissions ? */
    1.10 +
    1.11          SDL_Touch touch;
    1.12          touch.pressure_max = 0;
    1.13          touch.pressure_min = 0;
    1.14 @@ -66,8 +70,7 @@
    1.15          data->up = SDL_FALSE;
    1.16          data->down = SDL_FALSE;
    1.17  
    1.18 -        data->eventStream = open(tstr, 
    1.19 -                    O_RDONLY | O_NONBLOCK);
    1.20 +        data->eventStream = tsfd;
    1.21          ioctl (data->eventStream, EVIOCGNAME (sizeof (tstr)), tstr);
    1.22  
    1.23          int abs[5];