[PATCH - aconnect 1/1] Fix aconnect printing card and pid on older kernels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



alsa-lib is changed to return a distinct negative value if running on
an older kernel. -1 is only returned now if the kernel knows for sure
that there is no card or pid. On older kernels, alsa-lib will return
-ENOSYS.

Signed-off-by: Adam Goode <agoode@xxxxxxxxxx>

diff --git a/seq/aconnect/aconnect.c b/seq/aconnect/aconnect.c
index 85a7770..bbc5bb3 100644
--- a/seq/aconnect/aconnect.c
+++ b/seq/aconnect/aconnect.c
@@ -177,13 +177,13 @@ static void print_port(snd_seq_t *seq, snd_seq_client_info_t *cinfo,
 #ifdef HAVE_SEQ_CLIENT_INFO_GET_CARD
 		card = snd_seq_client_info_get_card(cinfo);
 #endif
-		if (card != -1)
+		if (card >= 0)
 			printf(",card=%d", card);
 
 #ifdef HAVE_SEQ_CLIENT_INFO_GET_PID
 		pid = snd_seq_client_info_get_pid(cinfo);
 #endif
-		if (pid != -1)
+		if (pid >= 0)
 			printf(",pid=%d", pid);
 		printf("]\n");
 	}
-- 
2.8.0.rc3.226.g39d4020

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux