[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 13/30] block/vvfat: Unify the mkdir() call
From: |
Alex Bennée |
Subject: |
[PATCH v4 13/30] block/vvfat: Unify the mkdir() call |
Date: |
Thu, 27 Oct 2022 19:36:19 +0100 |
From: Bin Meng <bin.meng@windriver.com>
There is a difference in the mkdir() call for win32 and non-win32
platforms, and currently is handled in the codes with #ifdefs.
glib provides a portable g_mkdir() API and we can use it to unify
the codes without #ifdefs.
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221006151927.2079583-6-bmeng.cn@gmail.com>
---
block/vvfat.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/block/vvfat.c b/block/vvfat.c
index d6dd919683..723beef025 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -25,6 +25,7 @@
#include "qemu/osdep.h"
#include <dirent.h>
+#include <glib/gstdio.h>
#include "qapi/error.h"
#include "block/block_int.h"
#include "block/qdict.h"
@@ -2726,13 +2727,9 @@ static int handle_renames_and_mkdirs(BDRVVVFATState* s)
mapping_t* mapping;
int j, parent_path_len;
-#ifdef __MINGW32__
- if (mkdir(commit->path))
+ if (g_mkdir(commit->path, 0755)) {
return -5;
-#else
- if (mkdir(commit->path, 0755))
- return -5;
-#endif
+ }
mapping = insert_mapping(s, commit->param.mkdir.cluster,
commit->param.mkdir.cluster + 1);
--
2.34.1
- [PATCH v4 08/30] tests/tcg: use regular semihosting for nios2-softmmu, (continued)
- [PATCH v4 08/30] tests/tcg: use regular semihosting for nios2-softmmu, Alex Bennée, 2022/10/27
- [PATCH v4 01/30] tests/docker: update fedora-win[32|64]-cross with lcitool, Alex Bennée, 2022/10/27
- [PATCH v4 02/30] tests/docker: update test-mingw to run single build, Alex Bennée, 2022/10/27
- [PATCH v4 14/30] hw/usb: dev-mtp: Use g_mkdir(), Alex Bennée, 2022/10/27
- [PATCH v4 12/30] util/qemu-sockets: Use g_get_tmp_dir() to get the directory for temporary files, Alex Bennée, 2022/10/27
- [PATCH v4 05/30] configure: fix the --enable-static --disable-pie case, Alex Bennée, 2022/10/27
- [PATCH v4 11/30] tcg: Avoid using hardcoded /tmp, Alex Bennée, 2022/10/27
- [PATCH v4 21/30] tests/tcg: re-enable linux-test for sh4, Alex Bennée, 2022/10/27
- [PATCH v4 06/30] tests/avocado: extend the timeout for x86_64 tcg tests, Alex Bennée, 2022/10/27
- [PATCH v4 13/30] block/vvfat: Unify the mkdir() call,
Alex Bennée <=
- [PATCH v4 22/30] tests/tcg: re-enable threadcount for sh4, Alex Bennée, 2022/10/27
- [PATCH v4 26/30] tests/tcg: include CONFIG_PLUGIN in config-host.mak, Alex Bennée, 2022/10/27
- [PATCH v4 16/30] MAINTAINERS: add features_to_c.sh to gdbstub files, Alex Bennée, 2022/10/27
- [PATCH v4 23/30] target/s390x: don't use ld_code2 to probe next pc, Alex Bennée, 2022/10/27
- [PATCH v4 20/30] tests/avocado: disable sh4 rd2 tests on Gitlab, Alex Bennée, 2022/10/27
- [PATCH v4 15/30] MAINTAINERS: add entries for the key build bits, Alex Bennée, 2022/10/27
- [PATCH v4 18/30] tests/avocado: set -machine none for userfwd and vnc tests, Alex Bennée, 2022/10/27
- [PATCH v4 17/30] MAINTAINERS: fix-up for check-tcg Makefile changes, Alex Bennée, 2022/10/27
- [PATCH v4 28/30] contrib/plugins: protect execlog's last_exec expansion, Alex Bennée, 2022/10/27