Skip to content

Commit

Permalink
Showing 3 changed files with 17 additions and 30 deletions.
22 changes: 0 additions & 22 deletions spec/truffle/tags/core/kernel/spawn_tags.txt
Original file line number Diff line number Diff line change
@@ -26,15 +26,6 @@ fails:Kernel#spawn raises a TypeError if given a symbol as :pgroup option
fails:Kernel#spawn uses the current working directory as its working directory
fails:Kernel#spawn uses the current umask by default
fails:Kernel#spawn sets the umask if given the :umask option
fails:Kernel#spawn redirects STDOUT to the given file descriptior if out: Fixnum
fails:Kernel#spawn redirects STDOUT to the given file if out: IO
fails:Kernel#spawn redirects STDOUT to the given file if out: String
fails:Kernel#spawn redirects STDERR to the given file descriptior if err: Fixnum
fails:Kernel#spawn redirects STDERR to the given file descriptor if err: IO
fails:Kernel#spawn redirects STDERR to the given file if err: String
fails:Kernel#spawn redirects both STDERR and STDOUT to the given file descriptior
fails:Kernel#spawn redirects both STDERR and STDOUT to the given IO
fails:Kernel#spawn does NOT redirect both STDERR and STDOUT at the time to the given name
fails:Kernel#spawn raises an ArgumentError if passed no command arguments
fails:Kernel#spawn raises an ArgumentError if passed env or options but no command arguments
fails:Kernel#spawn raises an ArgumentError if passed env and options but no command arguments
@@ -92,15 +83,6 @@ fails:Kernel.spawn raises a TypeError if given a symbol as :pgroup option
fails:Kernel.spawn uses the current working directory as its working directory
fails:Kernel.spawn uses the current umask by default
fails:Kernel.spawn sets the umask if given the :umask option
fails:Kernel.spawn redirects STDOUT to the given file descriptior if out: Fixnum
fails:Kernel.spawn redirects STDOUT to the given file if out: IO
fails:Kernel.spawn redirects STDOUT to the given file if out: String
fails:Kernel.spawn redirects STDERR to the given file descriptior if err: Fixnum
fails:Kernel.spawn redirects STDERR to the given file descriptor if err: IO
fails:Kernel.spawn redirects STDERR to the given file if err: String
fails:Kernel.spawn redirects both STDERR and STDOUT to the given file descriptior
fails:Kernel.spawn redirects both STDERR and STDOUT to the given IO
fails:Kernel.spawn does NOT redirect both STDERR and STDOUT at the time to the given name
fails:Kernel.spawn raises an ArgumentError if passed no command arguments
fails:Kernel.spawn raises an ArgumentError if passed env or options but no command arguments
fails:Kernel.spawn raises an ArgumentError if passed env and options but no command arguments
@@ -165,7 +147,3 @@ fails:Kernel.spawn when passed close_others: true does not close STDERR
fails:Kernel.spawn when passed close_others: false does not close STDIN
fails:Kernel.spawn when passed close_others: false does not close STDOUT
fails:Kernel.spawn when passed close_others: false does not close STDERR
fails:Kernel#spawn redirects STDOUT to the given file if out: [String name, String mode]
fails:Kernel.spawn redirects STDOUT to the given file if out: [String name, String mode]
fails:Kernel#spawn redirects STDERR to child STDOUT if :err => [:child, :out]
fails:Kernel.spawn redirects STDERR to child STDOUT if :err => [:child, :out]
7 changes: 0 additions & 7 deletions spec/truffle/tags/core/process/spawn_tags.txt
Original file line number Diff line number Diff line change
@@ -25,11 +25,6 @@ fails:Process.spawn raises a TypeError if given a symbol as :pgroup option
fails:Process.spawn uses the current working directory as its working directory
fails:Process.spawn uses the current umask by default
fails:Process.spawn sets the umask if given the :umask option
fails:Process.spawn redirects STDOUT to the given file if out: String
fails:Process.spawn redirects STDERR to the given file if err: String
fails:Process.spawn redirects both STDERR and STDOUT to the given file descriptior
fails:Process.spawn redirects both STDERR and STDOUT to the given IO
fails:Process.spawn does NOT redirect both STDERR and STDOUT at the time to the given name
fails:Process.spawn raises an ArgumentError if passed no command arguments
fails:Process.spawn raises an ArgumentError if passed env or options but no command arguments
fails:Process.spawn raises an ArgumentError if passed env and options but no command arguments
@@ -77,5 +72,3 @@ fails:Process.spawn when passed close_others: true does not close STDERR
fails:Process.spawn when passed close_others: false does not close STDIN
fails:Process.spawn when passed close_others: false does not close STDOUT
fails:Process.spawn when passed close_others: false does not close STDERR
fails:Process.spawn redirects STDOUT to the given file if out: [String name, String mode]
fails:Process.spawn redirects STDERR to child STDOUT if :err => [:child, :out]
Original file line number Diff line number Diff line change
@@ -97,8 +97,24 @@ private Collection<SpawnFileAction> parseOptions(DynamicObject options) {
for (int i = 0; i < size; i += 2) {
int from = (int) store[i];
int to = (int) store[i + 1];
if (to < 0) { // :child fd
to = -to - 1;
}
actions.add(SpawnFileAction.dup(to, from));
actions.add(SpawnFileAction.close(to));
}
continue;
} else if (key == getSymbol("assign_fd")) {
assert Layouts.ARRAY.isArray(value);
final DynamicObject array = (DynamicObject) value;
final int size = Layouts.ARRAY.getSize(array);
assert size % 4 == 0;
final Object[] store = ArrayOperations.toObjectArray(array);
for (int i = 0; i < size; i += 4) {
int fd = (int) store[i];
String path = StringOperations.getString(getContext(), (DynamicObject) store[i + 1]);
int flags = (int) store[i + 2];
int perms = (int) store[i + 3];
actions.add(SpawnFileAction.open(path, fd, flags, perms));
}
continue;
}

0 comments on commit c69b2f7

Please sign in to comment.