Commit 0efc3c4a authored by T(A)ILS developers's avatar T(A)ILS developers

Patched udev-watchdog.c to support multiple medias.

Udev does use the "change" action when the CD is ejected, rather than
the "remove" action it uses for usb removal. Udev-watchdog now takes
another argument, which is the media type, so that it exits on the
right action depending on this media type.
parent 29b7ea0b
......@@ -86,16 +86,25 @@ int main(int argc, char *argv[])
const char *filter_subsys = "block";
/* const char *filter_devtype = "partition"; */
const char *filter_action = "remove";
const char *filter_devsuffix;
const char *filter_devsuffix;
const char *filter_devtype;
const char *filter_action;
udev = udev_new();
if (udev == NULL)
goto out2;
if (argc != 2)
if (argc != 3)
goto out2;
filter_devsuffix = argv[1];
filter_devtype = argv[2];
if (strcmp(filter_devtype, "cd") == 0) {
filter_action = "change";
} else if (strcmp(filter_devtype, "disk") == 0) {
filter_action = "remove";
}
/* set signal handlers */
memset(&act, 0x00, sizeof(struct sigaction));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment