mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
elf: instead of an assert fail, return EACCES
This commit is contained in:
@@ -137,7 +137,9 @@ static int load(vnode_t *vnode, elfph64_t *ph) {
|
|||||||
|
|
||||||
int elf_load(vnode_t *vnode, void *base, void **entry, char **interpreter, auxv64list_t *auxv64) {
|
int elf_load(vnode_t *vnode, void *base, void **entry, char **interpreter, auxv64list_t *auxv64) {
|
||||||
// TODO return ETXTBUSY if node is open for writing
|
// TODO return ETXTBUSY if node is open for writing
|
||||||
__assert(vnode->type == V_TYPE_REGULAR);
|
if (vnode->type != V_TYPE_REGULAR)
|
||||||
|
return EACCES;
|
||||||
|
|
||||||
elfheader64_t header;
|
elfheader64_t header;
|
||||||
int err = readexact(vnode, &header, sizeof(elfheader64_t), 0);
|
int err = readexact(vnode, &header, sizeof(elfheader64_t), 0);
|
||||||
if (err)
|
if (err)
|
||||||
|
|||||||
Reference in New Issue
Block a user