tests: Use g_mkdir_with_parents()

Use the same g_mkdir_with_parents() call to create a directory on
all platforms.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20220824094029.1634519-13-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Bin Meng 2022-08-24 17:39:50 +08:00 committed by Thomas Huth
parent 3c239aa77e
commit 413bebc046
5 changed files with 12 additions and 12 deletions

View file

@ -232,7 +232,7 @@ static void stress(unsigned long long ramsizeGB, int ncpus)
static int mount_misc(const char *fstype, const char *dir)
{
if (mkdir(dir, 0755) < 0 && errno != EEXIST) {
if (g_mkdir_with_parents(dir, 0755) < 0 && errno != EEXIST) {
fprintf(stderr, "%s (%05d): ERROR: cannot create %s: %s\n",
argv0, gettid(), dir, strerror(errno));
return -1;