1 --- a/discover/event.h 2012-07-28 22:40:08.093065557 +0200
2 +++ b/discover/event.h 2012-07-28 22:40:24.293066501 +0200
11 --- a/discover/event.c 2012-07-28 22:39:12.509728991 +0200
12 +++ b/discover/event.c 2012-07-28 22:39:57.603064946 +0200
14 *action = EVENT_ACTION_ADD;
15 else if (streq(buf, "remove"))
16 *action = EVENT_ACTION_REMOVE;
17 + else if (streq(buf, "change"))
18 + *action = EVENT_ACTION_CHANGE;
20 pb_log("%s: unknown action: %s\n", __func__, buf);
22 --- a/discover/udev.c 2012-07-28 22:41:14.429736083 +0200
23 +++ b/discover/udev.c 2012-07-28 22:42:52.393075115 +0200
28 - action = event->action == EVENT_ACTION_ADD ? "add" : "remove";
29 + if (event->action == EVENT_ACTION_ADD)
31 + else if (event->action == EVENT_ACTION_REMOVE)
36 pb_log("udev %s event:\n", action);
37 pb_log("\tdevice: %s\n", event->device);
38 --- a/discover/device-handler.c 2012-07-28 22:43:10.363076160 +0200
39 +++ b/discover/device-handler.c 2012-07-28 23:01:50.729808008 +0200
44 +static int handle_change_udev_event(struct device_handler *handler,
45 + struct event *event)
47 + const char *disk_media_change;
48 + const char *disk_eject_request;
50 + disk_media_change = event_get_param(event, "DISK_MEDIA_CHANGE");
51 + if (disk_media_change) {
52 + return handle_add_udev_event(handler, event);
54 + disk_eject_request = event_get_param(event, "DISK_EJECT_REQUEST");
55 + if (disk_eject_request)
56 + return handle_remove_udev_event(handler, event);
62 static int handle_add_user_event(struct device_handler *handler,
66 case EVENT_ACTION_REMOVE:
67 rc = handle_remove_udev_event(handler, event);
69 + case EVENT_ACTION_CHANGE:
70 + rc = handle_change_udev_event(handler, event);
73 pb_log("%s unknown action: %d\n", __func__,