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:
Sergey Bugaev 2020-05-15 12:08:39 +03:00 committed by Andreas Kling
parent 752617cbb2
commit 888329233b
Notes: sideshowbarker 2024-07-19 06:38:19 +09:00

View file

@ -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;
}