blockdev-util: actually specify an access mode on open()

Linux is pretty lenient here, but we should specify the access mode.
This commit is contained in:
Lennart Poettering
2021-03-23 16:37:05 +01:00
parent 49bd547b38
commit 86b8610794
+1 -1
View File
@@ -68,7 +68,7 @@ int get_block_device(const char *path, dev_t *ret) {
/* Gets the block device directly backing a file system. If the block device is encrypted, returns
* the device mapper block device. */
fd = open(path, O_NOFOLLOW|O_CLOEXEC);
fd = open(path, O_RDONLY|O_NOFOLLOW|O_CLOEXEC);
if (fd < 0)
return -errno;