Преглед изворни кода

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

ambrop7 пре 15 година
родитељ
комит
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;
     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
     device_nextevent(mo);
     
-    // signal up
-    NCDModuleInst_Backend_Event(o->i, NCDMODULE_EVENT_UP);
-    
     return;
     
 fail1: