From nobody Sun Nov 2 11:45:23 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1527312370387431.0924711134377; Fri, 25 May 2018 22:26:10 -0700 (PDT) Received: from localhost ([::1]:47805 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRiT-0007hv-Iu for importer@patchew.org; Sat, 26 May 2018 01:26:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRgW-0006GO-Fr for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMRgV-0004WZ-Hs for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:08 -0400 Received: from mail-qt0-x229.google.com ([2607:f8b0:400d:c0d::229]:33228) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMRgV-0004W1-Db for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:07 -0400 Received: by mail-qt0-x229.google.com with SMTP id e8-v6so9196376qth.0 for ; Fri, 25 May 2018 22:24:07 -0700 (PDT) Received: from localhost.localdomain (96-86-104-61-static.hfc.comcastbusiness.net. [96.86.104.61]) by smtp.gmail.com with ESMTPSA id n128-v6sm17675166qkf.42.2018.05.25.22.24.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 May 2018 22:24:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juliacomputing-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=y1Lh5P2tzH4me3dG7tsoOK6wEE0ySr1pMNA1qm6ppZc=; b=TM4yZrWgdu19XUjAzokiFIa+Efu0AH6ZZ1VR7waXsr8xzejtIve2DOR18MYsDZYbaI y40dyBvpdRodX8zi93AXgy1qguBa4ZQf+No5EvtYeLh4z2ClUnI81GroUBcTKQ4zPnLK k9/CHUqzUzNsrM38tJ8adJkwSi7e0LCsFEHPvt6EIPBXCjaYLKEcqwAJcldrrbbcigxf ZNW94KAfrsxzgXtqNLjWBM4xnHvCMBsBUhzDpP0T5cCWF1Sh30+KZgXixKQlGFOZVMjn nZrkukW51R82lb46akF72olL6UUAzMVSRukSF/ac26Xg3d60Hf2gobohJJA+f7OSxlXL DTNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=y1Lh5P2tzH4me3dG7tsoOK6wEE0ySr1pMNA1qm6ppZc=; b=di18BAK9c7uJrKJAMcRtm83LCbuvPUHdYPQJr6qfb3AkBtClS456eSwMu6Rx3oTb4k 81ViW7dPQ+T+SbPolXZpqzDXCGww4zDbp4pdJXf6H+dbQIAlreMgidUAkYdxGCrCQLW/ dR9G8NsV4SRtNlMPmNd6vvnN3a1HlKAbdzh0fyBGcEbiEqVbQUYRd4QyF4Ml9gyvzuOA JKi3y8E7MnEDcRuxqD2NJNqO6UAWAox85lxaeVhFvcTBJN49mJrY6CyRl5KS5lplOnBq Ew9HZXbofHMJx7cuz2W+Wzm1Bk2kTd8u+sEkcHvnDo+2E2kb188hMlJ/wHnIKwi/9uyu NPhw== X-Gm-Message-State: ALKqPweb5I21vAL6UzrK+sIu/ZnSl0E+q7s+9htr4jG0+TcM+0n/VGPp U/GF6oY4DDyx4wM/WhVFl5W1F0NepPQ= X-Google-Smtp-Source: ADUXVKJcBJwKWOrRf30mk5czzQ0Y+XuGmOq2jc7MqzxGALmvkPyNV/StsdVBZxB7Mo004gn4MaXOlw== X-Received: by 2002:aed:2501:: with SMTP id v1-v6mr5192952qtc.66.1527312246485; Fri, 25 May 2018 22:24:06 -0700 (PDT) From: keno@juliacomputing.com To: qemu-devel@nongnu.org Date: Sat, 26 May 2018 01:23:08 -0400 Message-Id: <17b8b06c00e359d1cb71b883371ad8c677a0e477.1527310210.git.keno@alumni.harvard.edu> X-Mailer: git-send-email 2.8.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::229 Subject: [Qemu-devel] [PATCH 06/13] 9p: darwin: Address minor differences X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Keno Fischer , Keno Fischer , groug@kaod.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Keno Fischer - Darwin doesn't have strchrnul - Comparisons of mode_t with -1 require an explicit cast, since mode_t is unsigned on Darwin. Signed-off-by: Keno Fischer --- hw/9pfs/9p-local.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index fd65d04..6e0b2e8 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -67,7 +67,10 @@ int local_open_nofollow(FsContext *fs_ctx, const char *p= ath, int flags, assert(*path !=3D '/'); =20 head =3D g_strdup(path); - c =3D strchrnul(path, '/'); + /* equivalent to strchrnul(), but that is not available on Darwin = */ + c =3D strchr(path, '/'); + if (!c) + c =3D path + strlen(path); if (*c) { /* Intermediate path element */ head[c - path] =3D 0; @@ -310,7 +313,7 @@ update_map_file: if (credp->fc_gid !=3D -1) { gid =3D credp->fc_gid; } - if (credp->fc_mode !=3D -1) { + if (credp->fc_mode !=3D (mode_t)-1) { mode =3D credp->fc_mode; } if (credp->fc_rdev !=3D -1) { @@ -416,7 +419,7 @@ static int local_set_xattrat(int dirfd, const char *pat= h, FsCred *credp) return err; } } - if (credp->fc_mode !=3D -1) { + if (credp->fc_mode !=3D (mode_t)-1) { uint32_t tmp_mode =3D cpu_to_le32(credp->fc_mode); err =3D fsetxattrat_nofollow(dirfd, path, "user.virtfs.mode", &tmp= _mode, sizeof(mode_t), 0); --=20 2.8.1