Index: src/lib/eeze_udev_watch.c
===================================================================
--- src/lib/eeze_udev_watch.c	(revision 57482)
+++ src/lib/eeze_udev_watch.c	(working copy)
@@ -59,7 +59,7 @@
 {
    struct _store_data *store = data;
    _udev_device *device = NULL, *parent, *tmpdev;
-   const char *ret, *test;
+   const char *ret, *test, *action = NULL;
    Eeze_Udev_Watch_Cb func = store->func;
    void *sdata = store->data;
    Eeze_Udev_Watch *watch = store->watch;
@@ -175,6 +175,13 @@
             || (strcmp(test, "block")))
           goto error;
 #endif
+        action = udev_device_get_action(device);
+        if (!action)
+          goto error;
+
+        if (!strcmp(action, "remove"))
+          break;
+
         if ((!(test = udev_device_get_sysattr_value(device, "removable"))
              || (!strtol(test, NULL, 10)))
             && (!(test = udev_device_get_sysattr_value(device, "capability"))
@@ -247,13 +254,16 @@
         break;
      }
 
-   if ((!(test = udev_device_get_action(device)))
-       || (!(ret = udev_device_get_syspath(device))))
+   if (!action)
+     action = udev_device_get_action(device);
+   ret = udev_device_get_syspath(device);
+
+   if (!action || !ret)
      goto error;
 
    if (store->event)
      {
-        if (!strcmp(test, "add"))
+        if (!strcmp(action, "add"))
           {
              if ((store->event & EEZE_UDEV_EVENT_ADD) != EEZE_UDEV_EVENT_ADD)
                goto error;
@@ -261,7 +271,7 @@
              event |= EEZE_UDEV_EVENT_ADD;
           }
         else
-        if (!strcmp(test, "remove"))
+        if (!strcmp(action, "remove"))
           {
              if ((store->event & EEZE_UDEV_EVENT_REMOVE) !=
                  EEZE_UDEV_EVENT_REMOVE)
@@ -270,7 +280,7 @@
              event |= EEZE_UDEV_EVENT_REMOVE;
           }
         else
-        if (!strcmp(test, "change"))
+        if (!strcmp(action, "change"))
           {
              if ((store->event & EEZE_UDEV_EVENT_CHANGE) !=
                  EEZE_UDEV_EVENT_CHANGE)
@@ -279,7 +289,7 @@
              event |= EEZE_UDEV_EVENT_CHANGE;
           }
         else
-        if (!strcmp(test, "online"))
+        if (!strcmp(action, "online"))
           {
              if ((store->event & EEZE_UDEV_EVENT_ONLINE) !=
                  EEZE_UDEV_EVENT_ONLINE)
