File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 50
50
#include <sys/time.h>
51
51
#include <time.h>
52
52
#include <stdint.h>
53
+ #include <fcntl.h>
53
54
54
55
#if defined (__FreeBSD__ )
55
56
#include <dev/evdev/input.h>
@@ -388,6 +389,7 @@ xf86TslibUninit(__attribute__ ((unused)) InputDriverPtr drv,
388
389
free (priv -> samp_mt );
389
390
free (priv -> last_mt );
390
391
#endif
392
+ close (pInfo -> fd );
391
393
valuator_mask_free (& priv -> valuators );
392
394
xf86TslibControlProc (pInfo -> dev , DEVICE_OFF );
393
395
ts_close (priv -> ts );
@@ -463,8 +465,6 @@ static int xf86TslibInit(__attribute__ ((unused)) InputDriverPtr drv,
463
465
464
466
priv -> slots = 0 ;
465
467
466
- pInfo -> fd = ts_fd (priv -> ts );
467
-
468
468
ts_error_fn = errfn ;
469
469
470
470
/* process generic options */
@@ -475,6 +475,18 @@ static int xf86TslibInit(__attribute__ ((unused)) InputDriverPtr drv,
475
475
if (!priv -> valuators )
476
476
return BadValue ;
477
477
478
+ /* FIXME get the path from libts */
479
+ if (!s ) {
480
+ xf86IDrvMsg (pInfo , X_ERROR , "Please provide Option path or Device" );
481
+ return BadValue ;
482
+ }
483
+
484
+ pInfo -> fd = open (s , O_RDONLY );
485
+ if (pInfo -> fd == -1 ) {
486
+ xf86IDrvMsg (pInfo , X_ERROR , "Couldn't open %s\n" , s );
487
+ return BadValue ;
488
+ }
489
+
478
490
if (ioctl (pInfo -> fd , EVIOCGBIT (EV_ABS , sizeof (absbit )), absbit ) < 0 ) {
479
491
xf86IDrvMsg (pInfo , X_ERROR , "ioctl EVIOCGBIT failed" );
480
492
return BadValue ;
You can’t perform that action at this time.
0 commit comments