Skip to content

Commit

Permalink
Fix execve not setting errno in some cases
Browse files Browse the repository at this point in the history
DONE: RTOS-556
  • Loading branch information
agkaminski committed Aug 23, 2023
1 parent d1a034b commit fd9dae3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions unistd/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ int execve(const char *file, char *const argv[], char *const envp[])
sys_common.filePathBuff = calloc(PATH_MAX, sizeof(char));
if (sys_common.execBuff == NULL || sys_common.filePathBuff == NULL) {
sys_clear();
return -ENOMEM;
return SET_ERRNO(-ENOMEM);
}

interp = sys_common.execBuff;
Expand Down Expand Up @@ -170,7 +170,7 @@ int execve(const char *file, char *const argv[], char *const envp[])
if (sys_common.sbArgs == NULL) {
close(fd);
sys_clear();
return -ENOMEM;
return SET_ERRNO(-ENOMEM);
}

while (noargs-- > 0) {
Expand Down

0 comments on commit fd9dae3

Please sign in to comment.