spa: alsa: handle IN_IGNORED instead of IN_DELETE_SELF

`IN_IGNORED` event is sent whenever the watch is removed,
which includes when the entity is deleted among other things,
so watch that instead of the more specific `IN_DELETE_SELF`.

(cherry picked from commit 04b8a0c215)
This commit is contained in:
Barnabás Pőcze 2024-01-07 02:39:48 +01:00 committed by Robert Mader
parent 98f2b18277
commit dd03036667

View file

@ -857,7 +857,7 @@ static void impl_on_notify_events(struct spa_source *source)
process_card(this, ACTION_DISABLE, card->udev_device); process_card(this, ACTION_DISABLE, card->udev_device);
} }
/* /dev/snd/ might have been removed */ /* /dev/snd/ might have been removed */
if ((event->mask & (IN_DELETE_SELF | IN_MOVE_SELF))) if ((event->mask & (IN_IGNORED | IN_MOVE_SELF)))
deleted = true; deleted = true;
} }
} }
@ -876,7 +876,7 @@ static int start_inotify(struct impl *this)
return -errno; return -errno;
res = inotify_add_watch(notify_fd, "/dev/snd", res = inotify_add_watch(notify_fd, "/dev/snd",
IN_ATTRIB | IN_CLOSE_WRITE | IN_DELETE_SELF | IN_MOVE_SELF); IN_ATTRIB | IN_CLOSE_WRITE | IN_MOVE_SELF);
if (res < 0) { if (res < 0) {
res = -errno; res = -errno;
close(notify_fd); close(notify_fd);