]> git.alsa-project.org Git - alsa-utils.git/commitdiff
alsa-info: Skip reading empty SoundWire device info HEAD master
authorTakashi Iwai <tiwai@suse.de>
Wed, 16 Sep 2026 13:05:58 +0000 (15:05 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 16 Sep 2026 13:19:58 +0000 (15:19 +0200)
The SoundWire device status information is gathered from ACPI adr
sysfs files, but since we take only the entries for the known vendors,
this list can be empty, resulting in no $TEMPDIR/sdwstatus.tmp file
created.  This will end up with the unexpected (non-fatal) errors for
alsa-info.sh.

For addressing it, add the check of the existence of tmp file before
reading it.

Link: https://bugzilla.suse.com/show_bug.cgi?id=1279431
Signed-off-by: Takashi Iwai <tiwai@suse.de>
alsa-info/alsa-info.sh

index eac3694dc32b2e9cac82a266f4bee6d2125d593b..1ec11a376e2ef992e29bd7db5a7fbd85d82f36b9 100755 (executable)
@@ -549,7 +549,9 @@ echo "" >> $FILE
 echo "!!ACPI SoundWire Device Status Information" >> $FILE
 echo "!!---------------" >> $FILE
 echo "" >> $FILE
-cat $TEMPDIR/sdwstatus.tmp >> $FILE
+if [ -f $TEMPDIR/sdwstatus.tmp ]; then
+    cat $TEMPDIR/sdwstatus.tmp >> $FILE
+fi
 echo "" >> $FILE
 echo "" >> $FILE
 echo "!!Kernel Information" >> $FILE