8154921: Fix aix after "8146879: Add option for handling existing log files in UL"
authorgoetz
Fri, 22 Apr 2016 14:57:18 +0200
changeset 38065 025c784d9333
parent 38062 430e0a96ef1f
child 38066 e1d81d22523e
8154921: Fix aix after "8146879: Add option for handling existing log files in UL" Summary: Rename os::fileno to os::get_fileno because AIX defines macro 'fileno'. Reviewed-by: coleenp
hotspot/src/os/posix/vm/os_posix.cpp
hotspot/src/os/windows/vm/os_windows.cpp
hotspot/src/share/vm/logging/logFileOutput.cpp
hotspot/src/share/vm/runtime/os.hpp
--- a/hotspot/src/os/posix/vm/os_posix.cpp	Fri Apr 22 13:43:36 2016 +0200
+++ b/hotspot/src/os/posix/vm/os_posix.cpp	Fri Apr 22 14:57:18 2016 +0200
@@ -181,8 +181,8 @@
     return vsnprintf(buf, len, fmt, args);
 }
 
-int os::fileno(FILE* fp) {
-  return ::fileno(fp);
+int os::get_fileno(FILE* fp) {
+  return NOT_AIX(::)fileno(fp);
 }
 
 void os::Posix::print_load_average(outputStream* st) {
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Fri Apr 22 13:43:36 2016 +0200
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Fri Apr 22 14:57:18 2016 +0200
@@ -4602,7 +4602,7 @@
   return 0;
 }
 
-int os::fileno(FILE* fp) {
+int os::get_fileno(FILE* fp) {
   return _fileno(fp);
 }
 
--- a/hotspot/src/share/vm/logging/logFileOutput.cpp	Fri Apr 22 13:43:36 2016 +0200
+++ b/hotspot/src/share/vm/logging/logFileOutput.cpp	Fri Apr 22 14:57:18 2016 +0200
@@ -252,7 +252,7 @@
 
   if (_file_count == 0 && is_regular_file(_file_name)) {
     log_trace(logging)("Truncating log file");
-    os::ftruncate(os::fileno(_stream), 0);
+    os::ftruncate(os::get_fileno(_stream), 0);
   }
 
   return true;
--- a/hotspot/src/share/vm/runtime/os.hpp	Fri Apr 22 13:43:36 2016 +0200
+++ b/hotspot/src/share/vm/runtime/os.hpp	Fri Apr 22 14:57:18 2016 +0200
@@ -520,7 +520,7 @@
   static int ftruncate(int fd, jlong length);
   static int fsync(int fd);
   static int available(int fd, jlong *bytes);
-  static int fileno(FILE* fp);
+  static int get_fileno(FILE* fp);
 
   static int compare_file_modified_times(const char* file1, const char* file2);