mirror of
https://github.com/microsoft/WSL.git
synced 2025-12-10 00:44:55 -06:00
cleanup: add ChildName to UtilCreateChildProcess error message (#13103)
* cleanup: add ChildName to UtilCreateChildProcess error message * tweak error message --------- Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
This commit is contained in:
parent
b9a52e96c7
commit
1f0e66d25c
@ -1034,23 +1034,17 @@ try
|
||||
|
||||
if (Config.BootCommand.has_value())
|
||||
{
|
||||
const int ChildPid =
|
||||
UtilCreateChildProcess("BootCommand", [Command = Config.BootCommand.value(), SavedSignals = g_SavedSignalActions]() {
|
||||
//
|
||||
// Restore default signal dispositions for the child process.
|
||||
//
|
||||
UtilCreateChildProcess("BootCommand", [Command = Config.BootCommand.value(), SavedSignals = g_SavedSignalActions]() {
|
||||
//
|
||||
// Restore default signal dispositions for the child process.
|
||||
//
|
||||
|
||||
THROW_LAST_ERROR_IF(UtilSetSignalHandlers(SavedSignals, false) < 0);
|
||||
THROW_LAST_ERROR_IF(UtilRestoreBlockedSignals() < 0);
|
||||
THROW_LAST_ERROR_IF(UtilSetSignalHandlers(SavedSignals, false) < 0);
|
||||
THROW_LAST_ERROR_IF(UtilRestoreBlockedSignals() < 0);
|
||||
|
||||
execl("/bin/sh", "sh", "-c", Command.c_str(), nullptr);
|
||||
LOG_ERROR("execl() failed, {}", errno);
|
||||
});
|
||||
|
||||
if (ChildPid < 0)
|
||||
{
|
||||
LOG_ERROR("fork failed {}", errno);
|
||||
}
|
||||
execl("/bin/sh", "sh", "-c", Command.c_str(), nullptr);
|
||||
LOG_ERROR("execl() failed, {}", errno);
|
||||
});
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@ -1333,7 +1333,6 @@ try
|
||||
if (SessionLeader < 0)
|
||||
{
|
||||
Result = -1;
|
||||
LOG_ERROR("fork failed for session leader {}", errno);
|
||||
goto InitCreateSessionLeaderExit;
|
||||
}
|
||||
|
||||
|
||||
@ -172,7 +172,7 @@ Return Value:
|
||||
|
||||
if (ChildPid < 0)
|
||||
{
|
||||
LOG_ERROR("{} failed {}", CloneFlags ? "clone" : "fork", errno);
|
||||
LOG_ERROR("{} for {} failed {}", CloneFlags ? "clone" : "fork", ChildName, errno);
|
||||
return -1;
|
||||
}
|
||||
else if (ChildPid > 0)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user