BUG=http://code.google.com/p/v8/issues/detail?id=1533

Review URL: http://codereview.chromium.org/7335007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8600 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
yangguo@chromium.org 2011-07-11 13:48:10 +00:00
parent 2fe5a976c9
commit 6cb055ae5d

View File

@ -37,6 +37,7 @@
#include <sys/resource.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <arpa/inet.h>
#include <netinet/in.h>
@ -130,7 +131,10 @@ int OS::GetLastError() {
//
FILE* OS::FOpen(const char* path, const char* mode) {
return fopen(path, mode);
struct stat file_stat;
if (stat(path, &file_stat) == 0 && (file_stat.st_mode & S_IFREG))
return fopen(path, mode);
return NULL;
}