diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index b80f21827e4..3dafb2d7895 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -6207,6 +6207,17 @@ void VM_Crac::doit() { const char* details = 0 < linkret ? detailsbuf : ""; print_resources("JVM: FD fd=%d type=%s: details1=\"%s\" ", i, stat2strtype(fds.get_stat(i)->st_mode), details); + if (i < 3) // Check if std descriptors binded to file + { + if (!S_ISCHR(fds.get_stat(i)->st_mode)){ + print_resources(" Redirecting std from file to pseudo terminal \n"); + int fd_tmp=open("/dev/pts/0", O_WRONLY); + close(i); + dup2(fd_tmp, i); + close(fd_tmp); + continue; + } + } if (_vm_inited_fds.get_state(i, FdsInfo::CLOSED) != FdsInfo::CLOSED) { print_resources("OK: inherited from process env\n");