From patchwork Fri Jul 17 16:02:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 6817031 Return-Path: X-Original-To: patchwork-kvm@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 42EBB9F536 for ; Fri, 17 Jul 2015 16:02:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 75A4C2064D for ; Fri, 17 Jul 2015 16:02:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 80BD42067D for ; Fri, 17 Jul 2015 16:02:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752272AbbGQQC1 (ORCPT ); Fri, 17 Jul 2015 12:02:27 -0400 Received: from foss.arm.com ([217.140.101.70]:49671 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751905AbbGQQC0 (ORCPT ); Fri, 17 Jul 2015 12:02:26 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8E20660A; Fri, 17 Jul 2015 09:02:44 -0700 (PDT) Received: from e104803-lin.lan (unknown [10.1.203.153]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 296613F21A; Fri, 17 Jul 2015 09:02:25 -0700 (PDT) From: Andre Przywara To: will.deacon@arm.com, kvm@vger.kernel.org Cc: Szabolcs.Nagy@arm.com, marc.zyngier@arm.com, kvmarm@lists.cs.columbia.edu Subject: [PATCH 08/12] Fix call to connect() Date: Fri, 17 Jul 2015 17:02:14 +0100 Message-Id: <1437148938-5394-9-git-send-email-andre.przywara@arm.com> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1437148938-5394-1-git-send-email-andre.przywara@arm.com> References: <1437148938-5394-1-git-send-email-andre.przywara@arm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP According to the manpage and the prototype the second argument to connect(2) is a "const struct sockaddr*", so cast our protocol specific type back to the super type. This fixes compilation on musl-libc. Signed-off-by: Andre Przywara --- kvm-ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kvm-ipc.c b/kvm-ipc.c index a289d4b..857b0dc 100644 --- a/kvm-ipc.c +++ b/kvm-ipc.c @@ -99,7 +99,7 @@ int kvm__get_sock_by_instance(const char *name) strlcpy(local.sun_path, sock_file, sizeof(local.sun_path)); len = strlen(local.sun_path) + sizeof(local.sun_family); - r = connect(s, &local, len); + r = connect(s, (struct sockaddr *)&local, len); if (r < 0 && errno == ECONNREFUSED) { /* Tell the user clean ghost socket file */ pr_err("\"%s\" could be a ghost socket file, please remove it",