49 lines
1.6 KiB
Diff
49 lines
1.6 KiB
Diff
|
|
From af6c51e5ef35cdf966888fb6874944d9615384a8 Mon Sep 17 00:00:00 2001
|
||
|
|
From: Wanghe Xiao <xiaowanghe_yewu@cmss.chinamobile.com>
|
||
|
|
Date: Sat, 25 Nov 2023 02:20:54 -0800
|
||
|
|
Subject: [PATCH] hw/usb: dev-mtp: Use g_mkdir()
|
||
|
|
MIME-Version: 1.0
|
||
|
|
Content-Type: text/plain; charset=UTF-8
|
||
|
|
Content-Transfer-Encoding: 8bit
|
||
|
|
|
||
|
|
cherry picked from commit 34b55848a15bca120d9b9381881c40b045409ee9
|
||
|
|
|
||
|
|
Use g_mkdir() to create a directory on all platforms.
|
||
|
|
|
||
|
|
Signed-off-by: Bin Meng <bin.meng@windriver.com>
|
||
|
|
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
|
||
|
|
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
|
||
|
|
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
|
||
|
|
Message-Id: <20221006151927.2079583-8-bmeng.cn@gmail.com>
|
||
|
|
Message-Id: <20221027183637.2772968-15-alex.bennee@linaro.org>
|
||
|
|
Signed-off-by: Wanghe Xiao <xiaowanghe_yewu@cmss.chinamobile.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 c1d1694fd0..882f6bc72f 100644
|
||
|
|
--- a/hw/usb/dev-mtp.c
|
||
|
|
+++ b/hw/usb/dev-mtp.c
|
||
|
|
@@ -15,7 +15,7 @@
|
||
|
|
#include "qemu/error-report.h"
|
||
|
|
#include <wchar.h>
|
||
|
|
#include <dirent.h>
|
||
|
|
-
|
||
|
|
+#include <glib/gstdio.h>
|
||
|
|
#include <sys/statvfs.h>
|
||
|
|
|
||
|
|
|
||
|
|
@@ -1623,7 +1623,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,
|
||
|
|
--
|
||
|
|
2.27.0
|
||
|
|
|