From patchwork Thu Oct 27 18:36:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 619214 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp508350pvb; Thu, 27 Oct 2022 12:14:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4KO2pxTtOL6htE2dzRKBgfJ2C1OcI9SH1mioqd0G8V5BvOvH70tPqTDgdG1AI2rwDEkQs/ X-Received: by 2002:a05:622a:48d:b0:39e:354e:b551 with SMTP id p13-20020a05622a048d00b0039e354eb551mr29069314qtx.240.1666898079896; Thu, 27 Oct 2022 12:14:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666898079; cv=none; d=google.com; s=arc-20160816; b=xXu81piusVQyAlOO24rdeJf0wjIl3Z655HgEE3Vg1yHijeSsnNqB6899wAU0jSXNlm 04iaOwKt0TL4jhpEm5Pc9rnEzttNCJzGDzp+G1cUQ1+ywO1CP88Fz+RZVy4Vv9XdmfbH vMljUZ1v8cbJTjhaZqZqQq2X0WfQRKO0Kj/cSYWYodLd2AgPg3w1x8nhKz4F6eFUP8Gk jeenrXLpscfROQWjHrOG74FxKl3YNGYPM7WC75LSw4V5T8Q2+12xGXgIwI8FbQN31CLC 8ky0M62izV+mz/QMsAoCBYX+O7jedYfMlxgWCdLy+BL5tPl7KlRtHa2QVI8W48jkJs+S iRpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MAiwImJdpLFkde/JPFpGgiQK7JvaUA3H/HJ/OAPQFdQ=; b=GRgaYbV4vqBUqeg6a4tljDs3XZ2/rl5OG3U/Xo97SPz7mBGOZKXzJdQBZYcSpcaxiU K9B9Q+MIcyFDBTi0y3dCzldLjaU7clQhlrcuQNd0LCbC8kOSAWUO2f/mSXdZIYUsyduN DZWqrDMZdCQv+3CnUw/QSr2vDv4VlyvZbMuTTAcElQ6QxaoVZP6QkSoN6K4tRMDQ0BD2 HaYtrveh+yocNVLVICy7W4xzK+PP3P1jHFryOexmqwbVsO1xdu5xZ6A9ol691qCIdEJW 6uO3NWky4QaQkcGfkTKBfudNKPJCPKtAJiJR9HrH36c1RwU5FMGh7rLZMdbiV2dvEId6 kM9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N4VG243l; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q5-20020ac84105000000b00393a55e31f5si1350974qtl.756.2022.10.27.12.14.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Oct 2022 12:14:39 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N4VG243l; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oo7n4-0002Uy-69; Thu, 27 Oct 2022 14:39:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oo7kK-0001Oy-Ep for qemu-devel@nongnu.org; Thu, 27 Oct 2022 14:36:53 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oo7kH-0003MV-Rr for qemu-devel@nongnu.org; Thu, 27 Oct 2022 14:36:52 -0400 Received: by mail-wr1-x431.google.com with SMTP id k8so3710062wrh.1 for ; Thu, 27 Oct 2022 11:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MAiwImJdpLFkde/JPFpGgiQK7JvaUA3H/HJ/OAPQFdQ=; b=N4VG243lGGmBZy2+dYnysvDiOHY5bo0eHybyu3xZP3Y5w720Uki5JTsNxzuiXCbTDX KcIX8RpLb9KwDxd6ed0KD5YxbSW0pwFLJlKdgcs2fuAeAGsJmTKwviw69FFM1zad5vq6 lq2aGz9X5LU8VgNdF3nLhNtJw22Y4l0xyZbVj7EZc34kTquvh42rSC9kTcLQBvy7pWu/ xgAd+kBnbgu2gRm+wZrURi9qnveURIyORaBAN8zcnlSQ6K5Bek5L67V/Y69gnMNv27zD 8+qA29Z0wC1IFIOff5iY0QuaAc5UeM6SG27Q0nAjyQ/sbAz8Jdo2DV1FoWpkHVRQOJ9T 1Z+g== 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:message-id:reply-to; bh=MAiwImJdpLFkde/JPFpGgiQK7JvaUA3H/HJ/OAPQFdQ=; b=zb00ZpPBjousDXPD9JD30LAVeytNFj1SX823NxmPqEFT+6d4A7zUsACJyXR+/ArrSf Nm5Y5IeU2oJcM5RT33VW8Z+NYQkXfudnbkkJUt8VlL3yI0boSiCheo8nCMfbgarrynhu PiwAOWkPlazwU8m1rbrGpGg6g99eWq5GiBY0as7MwgD1A5OJg8OV3/7OIoRblFMS493V 6GC3n2EidCNU8Bk+SOLjl9WRAaI6LoicwLYTy9+jJB8Uj2vyXH9Qx227pi+OQ+y8//UJ 2V+ngyEyxAL+CALwJasKEfwAidVRj49iIHN8U61D3C0WDf3hrol2U1QinpZgcQzRee6y 8prA== X-Gm-Message-State: ACrzQf3NBapabudG8tcVqr6Qwae+zTkRlre3RjW/7ifXDf0/+9odwJHy ShgJHWvtiupoGm0scn5FHBK5Wg== X-Received: by 2002:a5d:564c:0:b0:236:6089:cc50 with SMTP id j12-20020a5d564c000000b002366089cc50mr18480773wrw.520.1666895808414; Thu, 27 Oct 2022 11:36:48 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id j3-20020a05600c1c0300b003b4ff30e566sm10658299wms.3.2022.10.27.11.36.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 11:36:44 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A63B31FFC5; Thu, 27 Oct 2022 19:36:38 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: fam@euphon.net, berrange@redhat.com, f4bug@amsat.org, aurelien@aurel32.net, pbonzini@redhat.com, stefanha@redhat.com, crosa@redhat.com, Bin Meng , Gerd Hoffmann , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PATCH v4 14/30] hw/usb: dev-mtp: Use g_mkdir() Date: Thu, 27 Oct 2022 19:36:20 +0100 Message-Id: <20221027183637.2772968-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027183637.2772968-1-alex.bennee@linaro.org> References: <20221027183637.2772968-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x431.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, 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bin Meng Use g_mkdir() to create a directory on all platforms. Signed-off-by: Bin Meng Acked-by: Gerd Hoffmann Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20221006151927.2079583-8-bmeng.cn@gmail.com> --- 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,