summaryrefslogtreecommitdiff
path: root/linux/blkdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/blkdev.c')
-rw-r--r--linux/blkdev.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/linux/blkdev.c b/linux/blkdev.c
index d073ed6a..3569594f 100644
--- a/linux/blkdev.c
+++ b/linux/blkdev.c
@@ -190,7 +190,10 @@ struct file *bdev_file_open_by_path(const char *path, blk_mode_t mode,
if (mode & BLK_OPEN_EXCL)
flags |= O_EXCL;
- fd = open(path, flags);
+ if (mode & BLK_OPEN_CREAT)
+ flags |= O_CREAT;
+
+ fd = open(path, flags, 0600);
if (fd < 0)
return ERR_PTR(-errno);