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

ncd: modules: sys_evdev: fix assertion failure when we get an error from the file descriptor while we're processing an
event

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

+ 5 - 1
ncd/modules/sys_evdev.c

@@ -99,7 +99,11 @@ MAKE_LOOKUP_FUNC(ffstatus)
 
 static void device_handler (struct instance *o, int events)
 {
-    ASSERT(!o->processing)
+    if (o->processing) {
+        ModuleLog(o->i, BLOG_ERROR, "device error");
+        instance_free(o, 1);
+        return;
+    }
     
     int res = read(o->evdev_fd, &o->event, sizeof(o->event));
     if (res < 0) {