Revision: 8600
Author:   [email protected]
Date:     Mon Jul 11 06:48:10 2011
Log:      bug fix
BUG=http://code.google.com/p/v8/issues/detail?id=1533

Review URL: http://codereview.chromium.org/7335007
http://code.google.com/p/v8/source/detail?r=8600

Modified:
 /branches/bleeding_edge/src/platform-posix.cc

=======================================
--- /branches/bleeding_edge/src/platform-posix.cc       Wed Jun 22 03:13:10 2011
+++ /branches/bleeding_edge/src/platform-posix.cc       Mon Jul 11 06:48:10 2011
@@ -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 @@
 //

 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;
 }


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to