Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add error handling for when readdir_r() fails

  • Loading branch information...
commit b3e58d2068bf2955cb98fbadd6409e7ec5b84d22 1 parent aa45fc7
@dbussink dbussink authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 vm/builtin/dir.cpp
View
4 vm/builtin/dir.cpp
@@ -81,7 +81,9 @@ namespace rubinius {
struct dirent ent;
struct dirent* entp = &ent;
- readdir_r(os_, entp, &entp);
+ if(int erno = readdir_r(os_, entp, &entp)) {
+ Exception::errno_error(state, "readdir_r(3) failed", erno);
+ }
if(!entp) return cNil;
return String::create(state, ent.d_name);
Please sign in to comment.
Something went wrong with that request. Please try again.