[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 10/39] hw/usb: dev-mtp: Use g_mkdir()
From: |
Bin Meng |
Subject: |
[PATCH v2 10/39] hw/usb: dev-mtp: Use g_mkdir() |
Date: |
Tue, 20 Sep 2022 18:31:30 +0800 |
From: Bin Meng <bin.meng@windriver.com>
Use g_mkdir() to create a directory on all platforms.
Signed-off-by: Bin Meng <bin.meng@windriver.com>
---
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 <wchar.h>
#include <dirent.h>
-
+#include <glib/gstdio.h>
#include <sys/statvfs.h>
@@ -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,
--
2.34.1
- Re: [PATCH v2 03/39] block: Unify the get_tmp_filename() implementation, (continued)
- [PATCH v2 05/39] tcg: Avoid using hardcoded /tmp, Bin Meng, 2022/09/20
- [PATCH v2 04/39] semihosting/arm-compat-semi: Avoid using hardcoded /tmp, Bin Meng, 2022/09/20
- [PATCH v2 08/39] block/vvfat: Unify the mkdir() call, Bin Meng, 2022/09/20
- [PATCH v2 02/39] tests/qtest: i440fx-test: Rewrite create_blob_file() to be portable, Bin Meng, 2022/09/20
- [PATCH v2 10/39] hw/usb: dev-mtp: Use g_mkdir(),
Bin Meng <=
- [PATCH v2 06/39] util/qemu-sockets: Use g_get_tmp_dir() to get the directory for temporary files, Bin Meng, 2022/09/20
- [PATCH v2 07/39] tests: Avoid using hardcoded /tmp in test cases, Bin Meng, 2022/09/20
- [PATCH v2 09/39] fsdev/virtfs-proxy-helper: Use g_mkdir(), Bin Meng, 2022/09/20
- [PATCH v2 11/39] tests/qtest: Skip running virtio-net-test cases that require socketpair() for win32, Bin Meng, 2022/09/20
- [PATCH v2 12/39] tests/qtest: Build test-filter-{mirror, redirector} cases for posix only, Bin Meng, 2022/09/20
- [PATCH v2 13/39] tests/qtest: qmp-test: Skip running test_qmp_oob for win32, Bin Meng, 2022/09/20