Commit 14066c0e authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

Check return code from fwrite

BUG=http://code.google.com/p/v8/issues/detail?id=453
TEST=none
Review URL: http://codereview.chromium.org/458016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3404 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d84d4796
......@@ -159,7 +159,11 @@ Handle<Value> Shell::Write(const Arguments& args) {
printf(" ");
}
v8::String::Utf8Value str(args[i]);
fwrite(*str, sizeof(**str), str.length(), stdout);
int n = fwrite(*str, sizeof(**str), str.length(), stdout);
if (n != str.length()) {
printf("Error in fwrite\n");
exit(1);
}
}
return Undefined();
}
......@@ -203,7 +207,7 @@ Handle<Value> Shell::Load(const Arguments& args) {
return ThrowException(String::New("Error loading file"));
}
if (!ExecuteString(source, String::New(*file), false, false)) {
return ThrowException(String::New("Error executing file"));
return ThrowException(String::New("Error executing file"));
}
}
return Undefined();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment