Skip to content

Commit

Permalink
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -286,15 +286,15 @@ public Object readIfAvailable(DynamicObject file, int numberOfBytes) {

if (res < 0) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().errnoError(getContext().getPosix().errno(), this));
throw new RaiseException(getContext().getCoreLibrary().errnoError(posix().errno(), this));
}

final byte[] bytes = new byte[numberOfBytes];
final int bytesRead = getContext().getPosix().read(fd, bytes, numberOfBytes);
final int bytesRead = posix().read(fd, bytes, numberOfBytes);

if (bytesRead == -1) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().errnoError(getContext().getPosix().errno(), this));
throw new RaiseException(getContext().getCoreLibrary().errnoError(posix().errno(), this));
}

if (bytesRead == 0) {
Original file line number Diff line number Diff line change
@@ -166,7 +166,7 @@ public VMGetUserHomePrimitiveNode(RubyContext context, SourceSection sourceSecti
public DynamicObject vmGetUserHome(DynamicObject username) {
CompilerDirectives.transferToInterpreter();
// TODO BJF 30-APR-2015 Review the more robust getHomeDirectoryPath implementation
final Passwd passwd = getContext().getPosix().getpwnam(username.toString());
final Passwd passwd = posix().getpwnam(username.toString());
if (passwd == null) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().argumentError("user " + username.toString() + " does not exist", this));

0 comments on commit 6bae7a6

Please sign in to comment.