From: Adam Goode <agoode@google.com>
To: patch@alsa-project.org
Cc: Adam Goode <agoode@google.com>,
alsa-devel@alsa-project.org, martin.koegler@chello.at
Subject: [PATCH - aconnect 1/1] Fix aconnect printing card and pid on older kernels
Date: Fri, 1 Apr 2016 13:35:01 -0400 [thread overview]
Message-ID: <1459532101-6582-1-git-send-email-agoode@google.com> (raw)
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@google.com>
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
next reply other threads:[~2016-04-01 17:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-01 17:35 Adam Goode [this message]
2016-04-01 21:28 ` [PATCH - aconnect 1/1] Fix aconnect printing card and pid on older kernels Martin Koegler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1459532101-6582-1-git-send-email-agoode@google.com \
--to=agoode@google.com \
--cc=alsa-devel@alsa-project.org \
--cc=martin.koegler@chello.at \
--cc=patch@alsa-project.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).