# HG changeset patch # User Emmanuel Gil Peyrot # Date 1439860155 -3600 # Node ID dec5fe6cd0d06062030a4d6b1004088e1cbe5efa # Parent 6aa40a25de223503428be83887ca0aa0208f22be Open the uinput device in write-only, and display every error. diff --git a/uinput.c b/uinput.c --- a/uinput.c +++ b/uinput.c @@ -28,15 +28,19 @@ int init_uinput_device(void){ int fd = -1; if(uinput_dev == NULL){ - fd = open("/dev/uinput", O_RDWR); + fd = open("/dev/uinput", O_WRONLY); - if(fd < 0) - fd = open("/dev/misc/uinput", O_RDWR); + if(fd < 0){ + perror("open"); + fd = open("/dev/misc/uinput", O_WRONLY); + } - if(fd < 0) - fd = open("/dev/input/uinput", O_RDWR); + if(fd < 0){ + perror("open"); + fd = open("/dev/input/uinput", O_WRONLY); + } } - else fd = open(uinput_dev, O_RDWR); //from xml + else fd = open(uinput_dev, O_WRONLY); //from xml if(fd < 0){ perror("open");