Skip to content

Commit f93911a

Browse files
Copilotadamsitnik
andauthored
Remove unnecessary ToInt32 conversions in Unix callback start path
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
1 parent 39ef8d1 commit f93911a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/libraries/System.Diagnostics.Process/src/Microsoft/Win32/SafeHandles/SafeProcessHandle.Unix.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,24 +259,24 @@ internal static unsafe SafeProcessHandle StartWithCallback(ProcessStartInfo star
259259
Debug.Assert(resolvedPathBytesWritten == resolvedPathByteCount);
260260
resolvedPathBuffer[resolvedPathBytesWritten] = (byte)0;
261261

262-
int stdinRawFd = -1, stdoutRawFd = -1, stderrRawFd = -1;
262+
nint stdinRawFd = -1, stdoutRawFd = -1, stderrRawFd = -1;
263263

264264
if (stdinFd is not null)
265265
{
266266
stdinFd.DangerousAddRef(ref stdinRefAdded);
267-
stdinRawFd = stdinFd.DangerousGetHandle().ToInt32();
267+
stdinRawFd = stdinFd.DangerousGetHandle();
268268
}
269269

270270
if (stdoutHandle is not null)
271271
{
272272
stdoutHandle.DangerousAddRef(ref stdoutRefAdded);
273-
stdoutRawFd = stdoutHandle.DangerousGetHandle().ToInt32();
273+
stdoutRawFd = stdoutHandle.DangerousGetHandle();
274274
}
275275

276276
if (stderrHandle is not null)
277277
{
278278
stderrHandle.DangerousAddRef(ref stderrRefAdded);
279-
stderrRawFd = stderrHandle.DangerousGetHandle().ToInt32();
279+
stderrRawFd = stderrHandle.DangerousGetHandle();
280280
}
281281

282282
fixed (byte* resolvedPathPtr = resolvedPathBuffer)

0 commit comments

Comments
 (0)