From patchwork Thu Oct 20 11:51:57 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: 616718 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp225232pvb; Thu, 20 Oct 2022 05:33:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4l9I55fujJyRyHfetCTbS6+waqyIRgzQMDhCoRJuDuWt/G4k2PrVMSv0gozg1p2yPmvMH3 X-Received: by 2002:ae9:dd04:0:b0:6e0:ae86:b4 with SMTP id r4-20020ae9dd04000000b006e0ae8600b4mr9001303qkf.146.1666269184936; Thu, 20 Oct 2022 05:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666269184; cv=none; d=google.com; s=arc-20160816; b=A7Jj/VYKuRieB4Shn453KqCKNBNYDQ96bz+7fSO2E+GObWkGDaOfmtlVsmTx3BTs/3 4X7Vcd95PlBC4HqvKPeWtJVCp1Tql5TAasUQXjkE+h6U9id6bnodVdnHSFJuv5XGp9ZG RmsuZK0zYoA8+rT0qirPv4hULN3ApgkxJBnOWFaYN46aLVDcHsrjVXeT8q3jjatI0T2a ukPEGLUGOkHulw1CWYvfIKlvGm5UyqTDIxsKojlSuYoeyraEjp2O+eTBcsppkr90VFN6 htD1yXlHUcSBoKyCwbjbqzm6admY3em4y9WaCE3MnyIGOCO6e5fqmU/Gf8BwPO+CI91E Tucg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=fCN3R4afVVo4Z95z0sef0bZEZD+cnjOSeEDcY2D2eDo=; b=ItqpTl7DyL+w/oVljzNt0hS1fMCF3MqAT0o+QcoBzJBGj2C3CJs9/X8l27hIZq49cQ eU8foekLsEA4iFLR3qHgIM4hkw6gWCcBRa+9T5ZrOoSyK4QZuPYcwdgjDis7PKu/vmCQ 5dXeeVx0Z8PRBgavwljbA5sQupYzFdiU4jYiW17ELaJky+O7yfQJbWZCB/gTa8tknkib iM8uGtwrS51zHps5dO1ywqgO0PavKCCWqsxbYLVAB1E19h/Y1ffBwiOjTmcEw9Txkjsj 9lsrsvP4lFLBx0LnRdK5/LwNP0AOO6hGC+VG0w8a+GxKOkFAMLxKr79F7MMiKPTtozmF NQiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kUTTVhWR; 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 gs7-20020a056214226700b004b2f6f4bf82si9861618qvb.153.2022.10.20.05.33.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Oct 2022 05:33:04 -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=kUTTVhWR; 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]:36728 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olUjQ-0001Z2-0N for patch@linaro.org; Thu, 20 Oct 2022 08:33:04 -0400 Received: from [::1] (helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olUdo-0004O2-5g for patch@linaro.org; Thu, 20 Oct 2022 08:27:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olU6B-0002f1-Ke for qemu-devel@nongnu.org; Thu, 20 Oct 2022 07:52:37 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:33678) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1olU64-0000nz-JD for qemu-devel@nongnu.org; Thu, 20 Oct 2022 07:52:31 -0400 Received: by mail-wm1-x32f.google.com with SMTP id n16-20020a05600c4f9000b003c17bf8ddecso2366030wmq.0 for ; Thu, 20 Oct 2022 04:52:22 -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=fCN3R4afVVo4Z95z0sef0bZEZD+cnjOSeEDcY2D2eDo=; b=kUTTVhWRgyWtzDk6P3qiFmK7pYBb3vUlPkiJZ9nPoUjGlxaUqz6CHHwNZn7VRXoIC6 qWJ7eE3gjv4uhqn0mQKFiylz1CbI4pKdmKDtCz3x4mGxIPk8n1EmwZXSHSPOF8HmA4FU 63Tc0U0dSsm/YL4FHs9QjAgVpLq1Dx9Pm8vFYRzR0UBCl3TK5a/fwoXJaa8J3lg//u7B fGLVCUOi74gJCJ66SE7zdmIMfezlhKQV9v9OYgEj+CeIgy//sOIGiv7J7j6P2dfLOu1q fwdXIrFWJoOtFBu1nUboOXZZfB81bNXLJD/eyf8edw+XbtKqn/vyNc1jn7IP5YN4G7N0 sMKg== 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=fCN3R4afVVo4Z95z0sef0bZEZD+cnjOSeEDcY2D2eDo=; b=qVX5jC1bObjVD/yiQCNXv4xjRjZfI15TwkcRnPRalafWbon77csWdwgEj+OKXYH4kX JOAdo0KgLoqwSeWiAbNXqayS8XtfeUxf0PNKCZ+p4CJ7gEvi6pQDBWMkfboTuKI579vC TTaJL1p8Gjcs4dm6A1p5at3tXRjRcHeLq9JlZn9L723zo5kSCYcZgxsyj2OwrjqoL6XM 6wXlxkBzj5XdGr9G9fwK2TTs8W2mSFSVHw3MyLd3v6HFafu1CWAGSHQKnFyTjQ3J/ePB mlIA051jheNfKBnA9D/W20KQYk4l7EchmpxHHmdmyxvyPTmRjCRgJ47SJPxh3pw/AXhY 7yRg== X-Gm-Message-State: ACrzQf3wU++l05e3Pm4Piz7j1XI6++lqXmunshRGHKFeYQEb2RglYUn4 pnwzTQEsUHRyEYgLRa4zYIYjTQ== X-Received: by 2002:a05:600c:4e52:b0:3b4:a828:1d84 with SMTP id e18-20020a05600c4e5200b003b4a8281d84mr28662683wmq.143.1666266742251; Thu, 20 Oct 2022 04:52:22 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id f16-20020a056000129000b0022dc6e76bbdsm16213241wrx.46.2022.10.20.04.52.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 04:52:17 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5C3591FFC5; Thu, 20 Oct 2022 12:52:11 +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?= Subject: [PATCH v3 14/26] hw/usb: dev-mtp: Use g_mkdir() Date: Thu, 20 Oct 2022 12:51:57 +0100 Message-Id: <20221020115209.1761864-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221020115209.1761864-1-alex.bennee@linaro.org> References: <20221020115209.1761864-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.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: , Errors-To: qemu-devel-bounces+patch=linaro.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 Signed-off-by: Alex Bennée 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,