File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
src/main/java/org/truffleruby Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1088,6 +1088,10 @@ public DynamicObject getKernelModule() {
1088
1088
return kernelModule ;
1089
1089
}
1090
1090
1091
+ public DynamicObject getErrnoModule () {
1092
+ return errnoModule ;
1093
+ }
1094
+
1091
1095
public GlobalVariables getGlobalVariables () {
1092
1096
return globalVariables ;
1093
1097
}
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ public String getWorkingDirectory() {
154
154
final Pointer buffer = GetThreadBufferNode .getBuffer (context , bufferSize );
155
155
final long address = nfi .asPointer ((TruffleObject ) getcwd .call (buffer .getAddress (), bufferSize ));
156
156
if (address == 0 ) {
157
- throw new UnsupportedOperationException ( "getcwd() failed " );
157
+ context . send ( context . getCoreLibrary (). getErrnoModule (), "handle " );
158
158
}
159
159
final byte [] bytes = buffer .readZeroTerminatedByteArray (context , 0 );
160
160
final Encoding localeEncoding = context .getEncodingManager ().getLocaleEncoding ();
You can’t perform that action at this time.
0 commit comments