Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 65cd0dd1c3b8
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: aa6a8cc1794d
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Nov 14, 2016

  1. Copy the full SHA
    729bc8a View commit details
  2. Copy the full SHA
    aa6a8cc View commit details
Original file line number Diff line number Diff line change
@@ -1254,7 +1254,7 @@ public static boolean fitsIntoInteger(long value) {
}

public static int long2int(long value) {
assert fitsIntoInteger(value);
assert fitsIntoInteger(value) : value;
return (int) value;
}

Original file line number Diff line number Diff line change
@@ -21,6 +21,9 @@
import jnr.posix.Times;
import org.jruby.truffle.core.CoreLibrary;

import com.kenai.jffi.Platform;
import com.kenai.jffi.Platform.OS;

import java.io.FileDescriptor;
import java.nio.ByteBuffer;
import java.util.Collection;
@@ -317,7 +320,15 @@ public Times times() {

@Override
public int posix_spawnp(String path, Collection<? extends SpawnFileAction> fileActions, Collection<? extends CharSequence> argv, Collection<? extends CharSequence> envp) {
return CoreLibrary.long2int(posix.posix_spawnp(path, fileActions, argv, envp));
final long pid = posix.posix_spawnp(path, fileActions, argv, envp);
// posix_spawnp() is declared as int return value, but jnr-posix declares as long.
if (Platform.getPlatform().getOS() == OS.SOLARIS) {
// Solaris/SPARCv9 has the int value in the wrong half.
// Due to big endian, we need to take the other half.
return (int) (pid >> 32);
} else {
return CoreLibrary.long2int(pid);
}
}

@Override