From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3DBCEC433EF for ; Mon, 25 Apr 2022 13:17:18 +0000 (UTC) Received: from localhost ([::1]:48658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niyab-000786-8p for qemu-devel@archiver.kernel.org; Mon, 25 Apr 2022 09:17:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niyZl-0005np-QD for qemu-devel@nongnu.org; Mon, 25 Apr 2022 09:16:25 -0400 Received: from us-smtp-delivery-44.mimecast.com ([205.139.111.44]:21617) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niyZj-00019Q-Ms for qemu-devel@nongnu.org; Mon, 25 Apr 2022 09:16:25 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-148-QvXvtK2pMQedaJdP_QGFxQ-1; Mon, 25 Apr 2022 09:16:11 -0400 X-MC-Unique: QvXvtK2pMQedaJdP_QGFxQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CECD6803D7C; Mon, 25 Apr 2022 13:16:10 +0000 (UTC) Received: from bahia (unknown [10.39.193.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id A5DBE40C1241; Mon, 25 Apr 2022 13:16:09 +0000 (UTC) Date: Mon, 25 Apr 2022 15:16:08 +0200 From: Greg Kurz To: Christian Schoenebeck Subject: Re: [PATCH v3 6/6] 9pfs: fix qemu_mknodat() to always return -1 on error on macOS host Message-ID: <20220425151608.19c3b1db@bahia> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Received-SPF: softfail client-ip=205.139.111.44; envelope-from=groug@kaod.org; helo=us-smtp-delivery-44.mimecast.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org, qemu-stable@nongnu.org, Keno Fischer , Michael Roitzsch , Will Cohen , Akihiko Odaki Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Mon, 25 Apr 2022 14:21:00 +0200 Christian Schoenebeck wrote: > qemu_mknodat() is expected to behave according to its POSIX API, and > therefore should always return exactly -1 on any error, and errno > should be set for the actual error code. > > Signed-off-by: Christian Schoenebeck > --- Reviewed-by: Greg Kurz > hw/9pfs/9p-util-darwin.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/hw/9pfs/9p-util-darwin.c b/hw/9pfs/9p-util-darwin.c > index 63797e60cd..7364da394c 100644 > --- a/hw/9pfs/9p-util-darwin.c > +++ b/hw/9pfs/9p-util-darwin.c > @@ -116,7 +116,8 @@ int qemu_mknodat(int dirfd, const char *filename, mode_t mode, dev_t dev) > } > if (!pthread_fchdir_np) { > error_report_once("pthread_fchdir_np() not available on this version of macOS"); > - return -ENOTSUP; > + errno = ENOTSUP; > + return -1; > } > if (pthread_fchdir_np(dirfd) < 0) { > return -1;