open for write MUST have the third parameter: mode

pull/40/head
YuQing 2021-07-01 07:41:29 +08:00
parent de879c15ee
commit 75b2aaee97
1 changed files with 1 additions and 1 deletions

View File

@ -886,7 +886,7 @@ static int get_block_size_by_write(const char *path, int *block_size)
snprintf(tmp_filename, sizeof(tmp_filename),
"%s/.blksize-test.tmp", path);
if ((fd=open(tmp_filename, O_WRONLY | O_CREAT | O_DIRECT)) < 0) {
if ((fd=open(tmp_filename, O_WRONLY | O_CREAT | O_DIRECT, 0755)) < 0) {
result = errno != 0 ? errno : ENOENT;
logError("file: "__FILE__", line: %d, "
"open file %s fail, errno: %d, error info: %s",