From patchwork Thu Jun 15 18:25:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Greer X-Patchwork-Id: 9789827 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 4280A60325 for ; Thu, 15 Jun 2017 18:26:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BD522861E for ; Thu, 15 Jun 2017 18:26:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30BD82862C; Thu, 15 Jun 2017 18:26:43 +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 E245A2861E for ; Thu, 15 Jun 2017 18:26:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752657AbdFOS0l (ORCPT ); Thu, 15 Jun 2017 14:26:41 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:55073 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753010AbdFOSZZ (ORCPT ); Thu, 15 Jun 2017 14:25:25 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 12E3220A75; Thu, 15 Jun 2017 14:25:19 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) 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=6gZ bUNnH6UZEwRuEF2xShT9qClXYG1IDdtERlUly46E=; b=NbkkK7kOsG8a2GPzJ6V ik1jej4gcy0QMmw04gwKlOrO1p9vo1zRcDWkOwCq1N/jbhEPnr26WmqOYjGCkNNq F3rZoIBbtp5IEBVmnDPO8aEkdGTjD5yjz2IN0HQNxitiXdQGd7td4RBwz8QLD+Oe o+FKwpBlXHt6bmUzHNOgLjo0= 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=6gZbUNnH6UZEwRuEF2xShT9qClXYG1IDdtERlUly4 6E=; b=X3APMFk3DtRJVpuKP7lBmvHLB73e+jIXXEi9Phb0A82r0rX5TxhlMSHkw 0g83P3gkmZT6/lHQX17w+fFjjZ7Tfq8+GsB1z+H2ZTCOUyWhER0npXG5QJ5BoXfj DnXS11cWCzMdcJwMqoSeavSW0Ii3y9gKqKrB7Jd7WzHROYGfwSAn3zWEKNpq8VqV gS8vJQ2OdQSZrMy19Rhh6IOrw5GNFOqL2e5nXX8n2ZWMEsadQLxExOFshlpYH2kj TCgsBCLsFIYxLVtNSEXM8dYm6Ghq+D0aJaza2Ce7gxFSk7xZklX9LoMAFUAVPi3c QojJcgziyU0S/UwWxFzI+CXyF/CEA== X-ME-Sender: X-Sasl-enc: cu4eKpUAtRl+D5SmzYeOfZb1iq2kolhSpAZ35Boh6pK9 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 C24F42494B; 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 B9556A20541; 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 08/23] adapter: Return '-errno' when connect() call fails Date: Thu, 15 Jun 2017 11:25:01 -0700 Message-Id: <20170615182516.4508-9-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 connect() 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 bfc64c2..466753b 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -1054,7 +1054,7 @@ int near_adapter_connect(uint32_t idx, uint32_t target_idx, uint8_t protocol) err = connect(sock, (struct sockaddr *) &addr, sizeof(addr)); if (err) { close(sock); - return err; + return -errno; } adapter->tag_sock = sock;