Skip to content

Commit

Permalink
hw/usb: dev-mtp: Use g_mkdir()
Browse files Browse the repository at this point in the history
Use g_mkdir() to create a directory on all platforms.

Signed-off-by: Bin Meng <[email protected]>
Acked-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <[email protected]>
Message-Id: <[email protected]>
  • Loading branch information
lbmeng authored and stsquad committed Oct 31, 2022
1 parent c263299 commit 34b5584
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hw/usb/dev-mtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "qemu/error-report.h"
#include <wchar.h>
#include <dirent.h>

#include <glib/gstdio.h>
#include <sys/statvfs.h>


Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 34b5584

Please sign in to comment.