GNOME Bugzilla – Bug 135597
make gstosselement properly deal with symlinks
Last modified: 2004-12-22 21:47:04 UTC
On my system (alsa + oss emulation), /dev/dsp is a symlink to /dev/dsp0 When trying to enumerate the available devices, gstosselement doesn't follow the /dev/dsp symlink, and thus fails to see it is a char device, and it doesn't test /dev/dsp0 at all. The attached patch makes gstosselement follow the symlink, but after thinking a bit more about it, it can create aliasing issues if it's a symlink to /dev/dspN, N > 1 Maybe it would be better not to follow symlinks, and to probe both /dev/dsp and /dev/dsp0.
Created attachment 24848 [details] [review] use stat instead of lstat
Here is a reworked version of the code enumerating oss devices. It looks for available /dev/dspN-/dev/mixerN and /dev/sound/dspN-/dev/sound/mixerN pairs, and detects duplicates using device numbers.
Created attachment 24909 [details] [review] improved patch
Looks sane, feel free to apply. If you want me to apply, please tell me.
I committed the patch to CVS HEAD.