+static void print_queue(const char *dir)
+{
+ LIST_HEAD(files);
+ struct name_entry *item;
+
+ if (add_matching_files(&files, dir, NULL) < 0)
+ return;
+
+ printf("\n\nAfter the udevadm settle timeout, the events queue contains:\n\n");
+
+ list_for_each_entry(item, &files, node) {
+ char target[NAME_SIZE];
+ size_t len;
+ const char *filename = strrchr(item->name, '/');
+
+ if (filename == NULL)
+ continue;
+ filename++;
+ if (*filename == '\0')
+ continue;
+
+ len = readlink(item->name, target, sizeof(target));
+ if (len < 0)
+ continue;
+ target[len] = '\0';
+
+ printf("%s: %s\n", filename, target);
+ }
+
+ printf("\n\n");
+}
+