From fee67d807bc36ff2cacb77286156798fd70e3f0c Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sun, 13 Apr 2025 08:33:40 -0400 Subject: linux shim: implement BLK_OPEN_CREAT this allows O_CREAT to be passed through, for the new image creation tool. Signed-off-by: Kent Overstreet --- linux/blkdev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'linux/blkdev.c') 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); -- cgit v1.2.3