From patchwork Fri Apr 1 17:35:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Goode X-Patchwork-Id: 8730731 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7C2D29F36E for ; Sat, 2 Apr 2016 06:55:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A6B0320383 for ; Sat, 2 Apr 2016 06:55:21 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7DFF42037F for ; Sat, 2 Apr 2016 06:55:20 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 91E93266AF5; Sat, 2 Apr 2016 08:55:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 91E572651A5; Sat, 2 Apr 2016 08:53:23 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id E5A44265177; Fri, 1 Apr 2016 19:35:12 +0200 (CEST) Received: from mail-yw0-f175.google.com (mail-yw0-f175.google.com [209.85.161.175]) by alsa0.perex.cz (Postfix) with ESMTP id D58E726512A for ; Fri, 1 Apr 2016 19:35:05 +0200 (CEST) Received: by mail-yw0-f175.google.com with SMTP id g3so176237268ywa.3 for ; Fri, 01 Apr 2016 10:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=DrcTj3fFa8HaZtTzoa9nGQ2PyHSHQd+jPZAJlx2f9PI=; b=SgMeKP5Wn6wckzP+NWnCYTwx6C0IqTICajGtH04Xv3F25R8i6k1/ugyNpffkh/1lw+ A+EIibUEHtkEede5DGf6/8fjT1lwmBE5E2zGeCigFwml0HfFQVN9x4JL7QoJDgz9VQ65 Avfp9nJJE75Q6MD5Y3Sg+YAt16qMu7ar709JLmukHDaxqTZfXV5tpHc6/AsbnsUbXdfR c7raWobh1jaCHT21JpZTXbETwJJSorzPUnFhj/ymLRNTwetLkQUR+mY3DEkxKGzkONNA vbfbbd7uxRh9S0tdI2we2noSfcrRkWUmZZZ4kROvPFAT9QvsjmGqvMAyafd88YXuWm9l M7bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=DrcTj3fFa8HaZtTzoa9nGQ2PyHSHQd+jPZAJlx2f9PI=; b=Kh+28upvyZE6pfaEyQlVA0781hG0ClbLhjasYYDrBIIEZz0m1OakBCkBdOIN35thva TJSY+3TOLD5lKhc5iSE+xzM6Y/uS6swxnbTQiRVZjUBcVGUTrbGOSjE1TqL1iBH1T8uw EqtcxsHLyBwtHRmeXvZejRznrPBlm3HNdBO5kpsk+5Wsjgd0jDLFQjKufDhfy8iCprS2 ncVzAm3cgc8hzO3MFy3ChJQL/PFLpHVvrkBE1FT6oCYT/bOR3dLNnplHLCxOZVn2ER9p rQyoQENn+tpV8VQApIbf1kar9ZgWBd2YXYw6vDRVVtTUFNvFaQbltldhvvBSdSLdiDel UH1Q== X-Gm-Message-State: AD7BkJIhFO8RoGQ4gami/Ye0VgVwwhLS52aL0Vji0vnMNCt0HtZJLsq2XPRnRarugnTv6k1J X-Received: by 10.37.82.5 with SMTP id g5mr10435913ybb.65.1459532105111; Fri, 01 Apr 2016 10:35:05 -0700 (PDT) Received: from wpg-ubiq154.hot.corp.google.com ([172.24.166.195]) by smtp.gmail.com with ESMTPSA id m188sm9283969ywe.46.2016.04.01.10.35.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Apr 2016 10:35:04 -0700 (PDT) From: Adam Goode To: patch@alsa-project.org Date: Fri, 1 Apr 2016 13:35:01 -0400 Message-Id: <1459532101-6582-1-git-send-email-agoode@google.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 X-Mailman-Approved-At: Sat, 02 Apr 2016 08:53:20 +0200 Cc: Adam Goode , alsa-devel@alsa-project.org, martin.koegler@chello.at Subject: [alsa-devel] [PATCH - aconnect 1/1] Fix aconnect printing card and pid on older kernels X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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"); }