Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fefe8b1

Browse files
committed
[refer #PGPRO-1745] Make remote mkdir operation synchronous
1 parent 3ff6a37 commit fefe8b1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/utils/file.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,10 @@ int fio_mkdir(char const* path, int mode, fio_location location)
697697
IO_CHECK(fio_write_all(fio_stdout, &hdr, sizeof(hdr)), sizeof(hdr));
698698
IO_CHECK(fio_write_all(fio_stdout, path, path_len), path_len);
699699

700-
return 0;
700+
IO_CHECK(fio_read_all(fio_stdin, &hdr, sizeof(hdr)), sizeof(hdr));
701+
Assert(hdr.cop == FIO_MKDIR);
702+
703+
return hdr.arg;
701704
}
702705
else
703706
{
@@ -1297,7 +1300,9 @@ void fio_communicate(int in, int out)
12971300
SYS_CHECK(remove(buf));
12981301
break;
12991302
case FIO_MKDIR: /* Create direcory */
1300-
SYS_CHECK(dir_create_dir(buf, hdr.arg));
1303+
hdr.size = 0;
1304+
hdr.arg = dir_create_dir(buf, hdr.arg);
1305+
IO_CHECK(fio_write_all(out, &hdr, sizeof(hdr)), sizeof(hdr));
13011306
break;
13021307
case FIO_CHMOD: /* Change file mode */
13031308
SYS_CHECK(chmod(buf, hdr.arg));

0 commit comments

Comments
 (0)