Просмотр исходного кода

ncd/modules/sys_evdev.c: nextevent() should call device_nextevent after going up

ambrop7 15 лет назад
Родитель
Сommit
45fb1014a4
1 измененных файлов с 5 добавлено и 3 удалено
  1. 5 3
      ncd/modules/sys_evdev.c

+ 5 - 3
ncd/modules/sys_evdev.c

@@ -313,12 +313,14 @@ static void nextevent_func_new (NCDModuleInst *i)
     struct instance *mo = i->method_object->inst_user;
     struct instance *mo = i->method_object->inst_user;
     ASSERT(mo->processing)
     ASSERT(mo->processing)
     
     
+    // signal up.
+    // Do it before finishing the event so our process does not advance any further if
+    // we would be killed the event provider going down.
+    NCDModuleInst_Backend_Event(o->i, NCDMODULE_EVENT_UP);
+    
     // wait for next event
     // wait for next event
     device_nextevent(mo);
     device_nextevent(mo);
     
     
-    // signal up
-    NCDModuleInst_Backend_Event(o->i, NCDMODULE_EVENT_UP);
-    
     return;
     return;
     
     
 fail1:
 fail1: