Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Stephen Toub <[email protected]>
  • Loading branch information
jeffhandley and stephentoub authored Jul 14, 2021
commit 09dc7e704adad0f6333077f568f845bcb444008a
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,8 @@ private bool ForkAndExecProcess(
{
if (string.IsNullOrEmpty(resolvedFilename))
{
int errno = Interop.Error.ENOENT.Info().RawErrno;
throw CreateExceptionForErrorStartingProcess(GetErrorMessage(errno), errno, startInfo.FileName, cwd);
Interop.ErrorInfo errno = Interop.Error.ENOENT.Info();
throw CreateExceptionForErrorStartingProcess(errno.GetErrorMessage(), errno.RawErrno, startInfo.FileName, cwd);
}

// Lock to avoid races with OnSigChild
Expand Down Expand Up @@ -550,7 +550,7 @@ private bool ForkAndExecProcess(
return false;
}

throw CreateExceptionForErrorStartingProcess(GetErrorMessage(errno), errno, resolvedFilename, cwd);
throw CreateExceptionForErrorStartingProcess(new ErrorInfo(errno).GetErrorMessage(), errno, resolvedFilename, cwd);
}
}
finally
Expand Down Expand Up @@ -1106,7 +1106,5 @@ private static int OnSigChild(int reapAll, int configureConsole)
s_processStartLock.ExitWriteLock();
}
}

private static string GetErrorMessage(int error) => Interop.Sys.StrError(error);
}
}