From 61e5eaa99a1b5dd8f059bce256c539e74a67955c Mon Sep 17 00:00:00 2001 From: Enrico Fraccaroli Date: Wed, 22 Dec 2021 15:21:08 +0100 Subject: [PATCH] Fix check on O_EXCL in procfs. --- mentos/src/fs/procfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mentos/src/fs/procfs.c b/mentos/src/fs/procfs.c index 1330895..bfc2c42 100644 --- a/mentos/src/fs/procfs.c +++ b/mentos/src/fs/procfs.c @@ -437,7 +437,7 @@ static vfs_file_t *procfs_open(const char *path, int flags, mode_t mode) procfs_file_t *procfs_file = procfs_find_entry_path(path); if (procfs_file != NULL) { // Check if the user wants to create a file. - if (bitmask_check(flags, O_CREAT)) { + if (bitmask_check(flags, O_CREAT | O_EXCL)) { pr_err("Cannot create, it exists `%s`.\n", path); errno = EEXIST; return NULL;