Skip to content

Commit 5c00a5d

Browse files
Add command parameter to `Process.replace´
1 parent 5d3faa0 commit 5c00a5d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/crystal/system/unix/process.cr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,9 @@ struct Crystal::System::Process
351351
lock_write { LibC.execvp(command, argv) }
352352
end
353353

354-
def self.replace(command_args, env, clear_env, input, output, error, chdir)
354+
def self.replace(command, command_args, env, clear_env, input, output, error, chdir)
355355
try_replace(command_args, env, clear_env, input, output, error, chdir)
356-
raise_exception_from_errno(command_args[0])
356+
raise_exception_from_errno(command)
357357
end
358358

359359
private def self.raise_exception_from_errno(command, errno = Errno.value)

src/crystal/system/wasi/process.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ struct Crystal::System::Process
9696
raise NotImplementedError.new("Process.prepare_args")
9797
end
9898

99-
def self.replace(command_args, env, clear_env, input, output, error, chdir)
99+
def self.replace(command, command_args, env, clear_env, input, output, error, chdir)
100100
raise NotImplementedError.new("Process.replace")
101101
end
102102

src/crystal/system/win32/process.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ struct Crystal::System::Process
343343
end
344344
end
345345

346-
private def self.try_replace(command_args, env, clear_env, input, output, error, chdir)
346+
private def self.try_replace(command, command_args, env, clear_env, input, output, error, chdir)
347347
old_input_fd = reopen_io(input, ORIGINAL_STDIN)
348348
old_output_fd = reopen_io(output, ORIGINAL_STDOUT)
349349
old_error_fd = reopen_io(error, ORIGINAL_STDERR)

0 commit comments

Comments
 (0)