Mercurial > hg > graal-jvmci-8
comparison src/share/vm/jvmci/jvmciRuntime.cpp @ 22553:114750c43459
JVMCIRuntime::parse_properties use ::read instead of os::read
author | Stefan Anzinger <stefan.anzinger@oracle.com> |
---|---|
date | Mon, 14 Sep 2015 14:40:16 +0200 |
parents | 71ea8d7db665 |
children | 5a706439be63 |
comparison
equal
deleted
inserted
replaced
22552:778602e2403c | 22553:114750c43459 |
---|---|
986 return klass; | 986 return klass; |
987 } | 987 } |
988 | 988 |
989 void JVMCIRuntime::parse_lines(char* path, ParseClosure* closure, bool warnStatFailure) { | 989 void JVMCIRuntime::parse_lines(char* path, ParseClosure* closure, bool warnStatFailure) { |
990 struct stat st; | 990 struct stat st; |
991 if (os::stat(path, &st) == 0 && (st.st_mode & S_IFREG) == S_IFREG) { // exists & is regular file | 991 if (::stat(path, &st) == 0 && (st.st_mode & S_IFREG) == S_IFREG) { // exists & is regular file |
992 int file_handle = os::open(path, 0, 0); | 992 int file_handle = ::open(path, 0, 0); |
993 if (file_handle != -1) { | 993 if (file_handle != -1) { |
994 char* buffer = NEW_C_HEAP_ARRAY(char, st.st_size + 1, mtInternal); | 994 char* buffer = NEW_C_HEAP_ARRAY(char, st.st_size + 1, mtInternal); |
995 int num_read; | 995 int num_read; |
996 num_read = (int) os::read(file_handle, (char*) buffer, st.st_size); | 996 num_read = (int) ::read(file_handle, (char*) buffer, st.st_size); |
997 if (num_read == -1) { | 997 if (num_read == -1) { |
998 warning("Error reading file %s due to %s", path, strerror(errno)); | 998 warning("Error reading file %s due to %s", path, strerror(errno)); |
999 } else if (num_read != st.st_size) { | 999 } else if (num_read != st.st_size) { |
1000 warning("Only read %d of " SIZE_FORMAT " bytes from %s", num_read, (size_t) st.st_size, path); | 1000 warning("Only read %d of " SIZE_FORMAT " bytes from %s", num_read, (size_t) st.st_size, path); |
1001 } | 1001 } |
1002 os::close(file_handle); | 1002 ::close(file_handle); |
1003 closure->set_filename(path); | 1003 closure->set_filename(path); |
1004 if (num_read == st.st_size) { | 1004 if (num_read == st.st_size) { |
1005 buffer[num_read] = '\0'; | 1005 buffer[num_read] = '\0'; |
1006 | 1006 |
1007 char* line = buffer; | 1007 char* line = buffer; |