2019-05-02 18:11:42 +03:00
|
|
|
Description: Reinitialize on any libusb error.
|
|
|
|
|
This allows g15daemon to correctly recover after suspend/resume.
|
|
|
|
|
Author: Alexander Ponyatykh <lazyranma@gmail.com>
|
|
|
|
|
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libusb/+bug/1357556
|
|
|
|
|
Forwarded: no
|
|
|
|
|
Last-Update: 2015-05-18
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/g15daemon/main.c
|
|
|
|
|
+++ b/g15daemon/main.c
|
2019-11-17 13:11:59 +03:00
|
|
|
@@ -203,11 +203,10 @@
|
|
|
|
|
g15daemon_send_event(masterlist->current->lcd,
|
2019-05-02 18:11:42 +03:00
|
|
|
G15_EVENT_KEYPRESS, keypresses);
|
|
|
|
|
lastkeys = keypresses;
|
2019-11-17 13:11:59 +03:00
|
|
|
-
|
2019-05-02 18:11:42 +03:00
|
|
|
- }else if(retval == -ENODEV && LIBG15_VERSION>=1200) {
|
2019-11-17 13:11:59 +03:00
|
|
|
+ }else if(retval != G15_NO_ERROR && retval != G15_ERROR_TIMEOUT && LIBG15_VERSION>=1200) {
|
|
|
|
|
+ g15daemon_log(LOG_WARNING,"Keyboard error (%d).. Reinitializing\n", retval);
|
2019-05-02 18:11:42 +03:00
|
|
|
pthread_mutex_lock(&g15lib_mutex);
|
|
|
|
|
while((retval=re_initLibG15() != G15_NO_ERROR) && !leaving){
|
|
|
|
|
- g15daemon_log(LOG_WARNING,"Keyboard has gone.. Retrying\n");
|
|
|
|
|
sleep(1);
|
|
|
|
|
}
|
|
|
|
|
if(!leaving) {
|