aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2013-09-24 15:22:00 +0200
committerGravatar Christian Hesse <mail@eworm.de>2013-09-24 15:22:00 +0200
commitd25e03550a26860cb50ad184eb3948e8396d2d61 (patch)
treed789bb5b58a3e4b3ec534818a0cbfbea083a7f63
parent34ff63a977ffc194a207b9421d00a2666b625ac3 (diff)
downloadudev-block-notify-d25e03550a26860cb50ad184eb3948e8396d2d61.tar.gz
udev-block-notify-d25e03550a26860cb50ad184eb3948e8396d2d61.tar.zst
ignore temporary device mapper devices
-rw-r--r--udev-block-notify.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/udev-block-notify.c b/udev-block-notify.c
index 706f962..4a8f439 100644
--- a/udev-block-notify.c
+++ b/udev-block-notify.c
@@ -148,6 +148,17 @@ int main (int argc, char ** argv) {
dev = udev_monitor_receive_device(mon);
if(dev) {
device = (char *) udev_device_get_sysname(dev);
+
+ /* ignore temporary device mapper devices
+ * is there a better way to do this? */
+ if (strncmp(device, "dm", 2) == 0 &&
+ udev_device_get_property_value(dev, "DM_NAME") == NULL) {
+# if DEBUG
+ printf("%s: Skipping temporary dm device %s\n", argv[0], device);
+# endif
+ continue;
+ }
+
devnum = udev_device_get_devnum(dev);
major = major(devnum);
minor = minor(devnum);