فهرست منبع

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

ambrop7 13 سال پیش
والد
کامیت
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) {