mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-24 18:03:25 +00:00
Handle error in FsResolver::create_new_file()
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
3929ea8c86
commit
d4036d1e9d
@ -131,7 +131,9 @@ impl FsResolver {
|
|||||||
return_errno_with_message!(Errno::EISDIR, "path refers to a directory");
|
return_errno_with_message!(Errno::EISDIR, "path refers to a directory");
|
||||||
}
|
}
|
||||||
|
|
||||||
let parent = lookup_ctx.parent().unwrap();
|
let parent = lookup_ctx
|
||||||
|
.parent()
|
||||||
|
.ok_or_else(|| Error::with_message(Errno::ENOENT, "parent not found"))?;
|
||||||
if !parent.mode()?.is_writable() {
|
if !parent.mode()?.is_writable() {
|
||||||
return_errno_with_message!(Errno::EACCES, "file cannot be created");
|
return_errno_with_message!(Errno::EACCES, "file cannot be created");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user