From patchwork Tue Sep 27 11:06:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 12990498 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 3B8F2C6FA8E for ; Tue, 27 Sep 2022 11:49:53 +0000 (UTC) Received: from localhost ([::1]:46626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1od960-0008AC-82 for qemu-devel@archiver.kernel.org; Tue, 27 Sep 2022 07:49:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1od8RO-0002pI-ER for qemu-devel@nongnu.org; Tue, 27 Sep 2022 07:08:00 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]:45810) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1od8RM-00050q-Ps for qemu-devel@nongnu.org; Tue, 27 Sep 2022 07:07:54 -0400 Received: by mail-pj1-x102d.google.com with SMTP id l9-20020a17090a4d4900b00205e295400eso413360pjh.4 for ; Tue, 27 Sep 2022 04:07:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=gkhXgeI8VVKYUE8bIuW2cVwuIZ0uivwbyCoudHIFJ54=; b=aIL7psVDzTxyXdfGTHyLPIZdEZsdOJKrdrj/Qow4zL77qmUZdW9NEwOaOs6wQW32/M gYkbOf/5Bne0DcUfmqv9NkBsNThq0kRXI0Y4tvgZcW2Y1/dklFiZAu+wgXuSxC6KbrAs boI8eNX1+cE4RlFKJcPnr5+j95AZSNX1SNGzpuBVjBev8gjq/xpwwCmLkNh4NGS28P30 WmbHuUcL2HqobUtZ8LMCwCMJRN3Bds/2Yk4I7UQiXiqDtw2kWIFxKzdTDO7UYUOKUv1L H5r0cbtcpvKklu1USUK34YqIDsL6T+5U3ggveuT4lzSMRTcJOrCQNM0GIxvHN6zsE5x6 gyeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=gkhXgeI8VVKYUE8bIuW2cVwuIZ0uivwbyCoudHIFJ54=; b=4T5PQefDnDBK+J1opyxjMxBqrvuUTMfhi0WQxab/EFKGs2V4pPHGxFM8G3XQRyqgQi VklhRIlaHty0NFvhTVmEgbu2G+mSZprDboZ1qSsq8a+2F6znwu/2DOvl3Sh87UioLXXi 6VmY5oTcXMvVc2FeCptbWRYp+F8Guo9TBaZkwlTIE2rPN9a4WEEx3Vpzf7etrSXPktg/ QrihmSnx4KUVvGoShmmQbDAb8t7i714jNU0sj7yd6KzpouXVKopMS5v8SvwWgyajqnQa p3AN669ErzoYRlbg0buuy+Qg+abujPYmJM5dp8JcWOPrtHjY0y4Pg7q++2LyB6gk/ZSX mTGw== X-Gm-Message-State: ACrzQf3Zczs+C4KxEwGCNGhYeft5H8iO85yRs/JfYpHQCPMVs4RYhG6Q GccjlCfWDWKtVWllUySt6c4Kxwr7/rY= X-Google-Smtp-Source: AMsMyM7jzJabzfNLbL2Z4gKunbSd+XQGC8xc4Tck2Q+joN1N7eHzICxOb/CelqSqXv+5hBzcsCC3Qg== X-Received: by 2002:a17:90a:2b0c:b0:203:b7b1:2ba2 with SMTP id x12-20020a17090a2b0c00b00203b7b12ba2mr3990073pjc.34.1664276871226; Tue, 27 Sep 2022 04:07:51 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id i7-20020a626d07000000b00540f2323f67sm1453601pfc.95.2022.09.27.04.07.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Sep 2022 04:07:50 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org, Thomas Huth Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Bin Meng , Christian Schoenebeck , Greg Kurz Subject: [PATCH v4 26/54] fsdev/virtfs-proxy-helper: Use g_mkdir() Date: Tue, 27 Sep 2022 19:06:04 +0800 Message-Id: <20220927110632.1973965-27-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220927110632.1973965-1-bmeng.cn@gmail.com> References: <20220927110632.1973965-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=bmeng.cn@gmail.com; helo=mail-pj1-x102d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bin Meng Use g_mkdir() to create a directory on all platforms. Signed-off-by: Bin Meng Reviewed-by: Christian Schoenebeck --- (no changes since v2) Changes in v2: - Change to use g_mkdir() fsdev/virtfs-proxy-helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c index 2dde27922f..5cafcd7703 100644 --- a/fsdev/virtfs-proxy-helper.c +++ b/fsdev/virtfs-proxy-helper.c @@ -10,6 +10,7 @@ */ #include "qemu/osdep.h" +#include #include #include #include @@ -639,7 +640,7 @@ static int do_create_others(int type, struct iovec *iovec) if (retval < 0) { goto err_out; } - retval = mkdir(path.data, mode); + retval = g_mkdir(path.data, mode); break; case T_SYMLINK: retval = proxy_unmarshal(iovec, offset, "ss", &oldpath, &path);