From patchwork Thu Jun 15 18:25:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Greer X-Patchwork-Id: 9789807 X-Patchwork-Delegate: sameo@linux.intel.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0E20D60325 for ; Thu, 15 Jun 2017 18:26:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05DB92861E for ; Thu, 15 Jun 2017 18:26:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEE612862C; Thu, 15 Jun 2017 18:25:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D1CC2861E for ; Thu, 15 Jun 2017 18:25:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753245AbdFOSZ6 (ORCPT ); Thu, 15 Jun 2017 14:25:58 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:52645 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753188AbdFOSZa (ORCPT ); Thu, 15 Jun 2017 14:25:30 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 3728F20A82; Thu, 15 Jun 2017 14:25:19 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Thu, 15 Jun 2017 14:25:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=animalcreek.com; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=5Gn M8XQkbx4x+IiSObkpI9pmhC1QW6xkJmwkiHK4k4g=; b=RGS8E7BwrjZForwiCtm LfuxaIf+FZBI6nI7ACoX0Bx8Kd5lDrtL7BPHgeQr85BKaq/Yg5bCBOLbWx3Bs6TJ W3qQtqLuaYyLq5oK8KCjbWp1As2lUWkeDWB4oj0QwxY74TIxWjdOpYc/g7+m68cR cFvhdmrHkO+7G2rwaDTpothk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=5GnM8XQkbx4x+IiSObkpI9pmhC1QW6xkJmwkiHK4k 4g=; b=QdpKVfdBVXbOre7+13pgoJLwT5bnGwC6lT7rseOS1O1g9nCQg7AAFj94p qKaKvOWU2+XpagkFnENMA0qGO2Itafewe8sFiHIktsSz8Jy6wVHipP5Ow7OhALuQ 665IF6mLKWM3JA7ymjvV+PRbO8VSdyCRL1kCQWqBP9vnvxhyTPMQHy+0aPNHoYLn kmx0r7MMozZcuaZM+T6/fU5b6cQ7EvDbmyouf2SVOE+fplUDillFILb9ZYbbUdc6 /5r0QVsDCNifwbhRYkFu66G1Yv+XGrHWxucCSnDrFA7zcu4F+HNhaRo3sPABEDX/ 8UT9COt/Hj2PhMc2gs5xUTCQ2KYpg== X-ME-Sender: X-Sasl-enc: cu4bIoYKtQRrB4amzYeOfZb1iq2kolhSpAZ35Boh6pK9 1497551118 Received: from blue.animalcreek.com (ip68-2-81-12.ph.ph.cox.net [68.2.81.12]) by mail.messagingengine.com (Postfix) with ESMTPA id E17CE7E970; Thu, 15 Jun 2017 14:25:18 -0400 (EDT) Received: from blue.animalcreek.com (localhost [127.0.0.1]) by blue.animalcreek.com (Postfix) with ESMTP id AE538A2053F; Thu, 15 Jun 2017 11:25:17 -0700 (MST) From: Mark Greer To: Samuel Ortiz Cc: linux-wireless@vger.kernel.org, linux-nfc@lists.01.org, Mark Greer Subject: [PATCH 07/23] adapter: Return '-errno' when socket() call fails Date: Thu, 15 Jun 2017 11:25:00 -0700 Message-Id: <20170615182516.4508-8-mgreer@animalcreek.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170615182516.4508-1-mgreer@animalcreek.com> References: <20170615182516.4508-1-mgreer@animalcreek.com> Organization: Animal Creek Technologies, Inc. Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP near_adapter_connect() incorrectly returns '-1' when the socket() call fails. Instead, it should return '-errno' which is the real error code. Signed-off-by: Mark Greer --- src/adapter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adapter.c b/src/adapter.c index bc29ace..bfc64c2 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -1044,7 +1044,7 @@ int near_adapter_connect(uint32_t idx, uint32_t target_idx, uint8_t protocol) sock = socket(AF_NFC, SOCK_SEQPACKET, NFC_SOCKPROTO_RAW); if (sock == -1) - return sock; + return -errno; addr.sa_family = AF_NFC; addr.dev_idx = idx;