LibC: Fix execvp() errno
Of course, using dbg() in the middle will change errno (most likely, reset it to zero).
This commit is contained in:
parent
752617cbb2
commit
888329233b
Notes:
sideshowbarker
2024-07-19 06:38:19 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/888329233bb Pull-request: https://github.com/SerenityOS/serenity/pull/2231
1 changed files with 3 additions and 1 deletions
|
@ -135,7 +135,9 @@ int execvpe(const char* filename, char* const argv[], char* const envp[])
|
|||
int execvp(const char* filename, char* const argv[])
|
||||
{
|
||||
int rc = execvpe(filename, argv, environ);
|
||||
dbg() << "execvp() about to return " << rc << " with errno=" << errno;
|
||||
int saved_errno = errno;
|
||||
dbg() << "execvp() about to return " << rc << " with errno=" << saved_errno;
|
||||
errno = saved_errno;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue