mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-08 20:05:54 +00:00
lx_fs: fix errno EEXIST not propagated
This commit introduces a fix for lx_fs to propagate errno EEXIST error. This prevents vfs <import overwrite="false"> to overwrite an imported file, if it already exists, without the overwrite flag set to true. Issue genodelabs#4104
This commit is contained in:
parent
0f0edc0134
commit
e65b7f3b82
@ -39,8 +39,12 @@ class Lx_fs::File : public Node
|
||||
if (create) {
|
||||
mode_t ugo = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
|
||||
ret = mknodat(dir, name, S_IFREG | ugo, 0);
|
||||
|
||||
if (ret == -1 && errno != EEXIST)
|
||||
throw No_space();
|
||||
|
||||
if (errno == EEXIST)
|
||||
throw Node_already_exists();
|
||||
}
|
||||
|
||||
struct stat s;
|
||||
|
Loading…
x
Reference in New Issue
Block a user