From patchwork Tue Sep 27 11:06:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 12990512 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 A006AC6FA82 for ; Tue, 27 Sep 2022 12:14:25 +0000 (UTC) Received: from localhost ([::1]:50514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1od9Tk-0003pH-Pt for qemu-devel@archiver.kernel.org; Tue, 27 Sep 2022 08:14:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1od8RQ-0002qZ-UX for qemu-devel@nongnu.org; Tue, 27 Sep 2022 07:08:00 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]:41644) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1od8RO-0004xW-Cn for qemu-devel@nongnu.org; Tue, 27 Sep 2022 07:07:55 -0400 Received: by mail-pf1-x433.google.com with SMTP id l65so9352340pfl.8 for ; Tue, 27 Sep 2022 04:07:54 -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=gBbYIR+cYUeZZvc5gKxNpLwekX68RaD7k9jxuyBt2nM=; b=ZH2vmD1Wf5G3PqqtZJ2ie7tTclMP8rHBkHWGAV1ZIlIpzobWKcktUQAH0F6EXI4asP FKplnaqBFk3Q2ZN6pkcTDmUpVcjnY3B4AO6TAFhIc5EY32ThRZmDxja9laZeJ2l2Ocst A3DRK68DqBkFx0SWrBICHlcuusTIDS6J+mUJrR7W7WeWJVehC92GeJ51IZI4fmqRHpzW cuKbv+EoCzQ6/mQtFnHKVFeSTI6Y/+IbYxWjLRuRqIRwfrF1xIcwREe+BMu66HjlNUrb OXZJQeyYd9nqsNoF/BCNuyR9S3t8kA30HMBNSwtS9Lt8l1TXi/vYSPU+OtTDbwCsGwzl 7u6Q== 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=gBbYIR+cYUeZZvc5gKxNpLwekX68RaD7k9jxuyBt2nM=; b=msfvwBd+eXA/2P1oMqJUiLtIafetdkrPVkA3p5G4ykXWkkBiedgbEzak8B8GUq69rr YV4MIS9FsI8wiJVJ4tKeQb1cuGJmwEBugITDmDkDcboWa3i/4j3heqV8cVkx/vz8gE9g OOUBCSSRRdAPtXreGJllQ5C8FjyUtenQjtnI0N1lrvAfmjpTLStKBVUpaQuwJMGlVlSD OqHvln0tAFziHuXwJx809tWhX+6C8bBaknuBSlbFnKxjYK4rP9aW39XWjO/1rPRkA6DA sc9Nj/0lMa74HATFx1WjDx0y8pumYcxGIgUiLvdGMBkVkLPghwI1CAQ6tZp6U3kCoewg YQkg== X-Gm-Message-State: ACrzQf0MvXzlHluuh5DFcs32iMExOlHr2smKUzQiI+U1A2/apgsJ3noy p2N8zC0Od9eJYByXd38dKqjHOZk2njc= X-Google-Smtp-Source: AMsMyM7ootSD71GeBb73+8dniz07/PXoyp5mjwIXqXPFnCBD01r9EH6VF2eDPeoAPsLOdv/XsK7OGw== X-Received: by 2002:a05:6a00:1d82:b0:541:1ea2:e7e with SMTP id z2-20020a056a001d8200b005411ea20e7emr28909637pfw.71.1664276873457; Tue, 27 Sep 2022 04:07:53 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Sep 2022 04:07:53 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org, Thomas Huth Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Bin Meng , Gerd Hoffmann Subject: [PATCH v4 27/54] hw/usb: dev-mtp: Use g_mkdir() Date: Tue, 27 Sep 2022 19:06:05 +0800 Message-Id: <20220927110632.1973965-28-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::433; envelope-from=bmeng.cn@gmail.com; helo=mail-pf1-x433.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 Acked-by: Gerd Hoffmann --- (no changes since v2) Changes in v2: - Change to use g_mkdir() hw/usb/dev-mtp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 5831395cef..1cac1cd435 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -14,7 +14,7 @@ #include "qemu/error-report.h" #include #include - +#include #include @@ -1622,7 +1622,7 @@ static void usb_mtp_write_data(MTPState *s, uint32_t handle) if (s->dataset.filename) { path = g_strdup_printf("%s/%s", parent->path, s->dataset.filename); if (s->dataset.format == FMT_ASSOCIATION) { - ret = mkdir(path, mask); + ret = g_mkdir(path, mask); if (!ret) { usb_mtp_queue_result(s, RES_OK, d->trans, 3, QEMU_STORAGE_ID,