aboutsummaryrefslogtreecommitdiff
path: root/tests/test-util-filemonitor.c
diff options
context:
space:
mode:
authorYonggang Luo <luoyonggang@gmail.com>2020-09-06 04:34:25 +0800
committerThomas Huth <thuth@redhat.com>2020-09-07 12:34:17 +0200
commit0fdc1f2f5e0998f7daf49a8ead5a2007822c64be (patch)
tree2393eeb053c3de066785b0e7c13cb90be85c452c /tests/test-util-filemonitor.c
parent85c93c57f162e47025441ce39e2aadd0c1e0914f (diff)
downloadqemu-0fdc1f2f5e0998f7daf49a8ead5a2007822c64be.zip
qemu-0fdc1f2f5e0998f7daf49a8ead5a2007822c64be.tar.gz
qemu-0fdc1f2f5e0998f7daf49a8ead5a2007822c64be.tar.bz2
tests: Fixes building test-util-filemonitor.c on msys2/mingw
Fixes the following compiling error: ../tests/test-util-filemonitor.c: In function 'test_file_monitor_events': ../tests/test-util-filemonitor.c:620:17: error: too many arguments to function 'mkdir' 620 | if (mkdir(pathsrc, 0700) < 0) { | ^~~~~ In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h:10, from C:/work/xemu/qemu/include/qemu/osdep.h:93, from ../tests/test-util-filemonitor.c:21: C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/io.h:282:15: note: declared here 282 | int __cdecl mkdir (const char *) __MINGW_ATTRIB_DEPRECATED_MSVC2005; | ^~~~~ Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Message-Id: <20200905203425.1470-1-luoyonggang@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/test-util-filemonitor.c')
-rw-r--r--tests/test-util-filemonitor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test-util-filemonitor.c b/tests/test-util-filemonitor.c
index 8f0eff3..b629e10 100644
--- a/tests/test-util-filemonitor.c
+++ b/tests/test-util-filemonitor.c
@@ -23,6 +23,8 @@
#include "qapi/error.h"
#include "qemu/filemonitor.h"
+#include <glib/gstdio.h>
+
#include <utime.h>
enum {
@@ -617,7 +619,7 @@ test_file_monitor_events(void)
if (debug) {
g_printerr("Mkdir %s\n", pathsrc);
}
- if (mkdir(pathsrc, 0700) < 0) {
+ if (g_mkdir_with_parents(pathsrc, 0700) < 0) {
g_printerr("Unable to mkdir %s: %s",
pathsrc, strerror(errno));
goto cleanup;