< prev index next >
src/os/linux/vm/os_linux.cpp
Print this page
rev 11179 : 8140594: Various minor code improvements (compiler)
Reviewed-by: thartmann
*** 1911,1923 ****
int fd = ::open(filename, O_RDONLY);
if (fd == -1) {
return false;
}
! char buf[32];
int bytes;
! while ((bytes = ::read(fd, buf, sizeof(buf))) > 0) {
st->print_raw(buf, bytes);
}
::close(fd);
--- 1911,1924 ----
int fd = ::open(filename, O_RDONLY);
if (fd == -1) {
return false;
}
! char buf[33];
int bytes;
! buf[32] = '\0';
! while ((bytes = ::read(fd, buf, sizeof(buf)-1)) > 0) {
st->print_raw(buf, bytes);
}
::close(fd);
*** 6077,6087 ****
bool yes = os::message_box("Unexpected Error", buf);
if (yes) {
// yes, user asked VM to launch debugger
! jio_snprintf(buf, sizeof(buf), "gdb /proc/%d/exe %d",
os::current_process_id(), os::current_process_id());
os::fork_and_exec(buf);
yes = false;
}
--- 6078,6088 ----
bool yes = os::message_box("Unexpected Error", buf);
if (yes) {
// yes, user asked VM to launch debugger
! jio_snprintf(buf, sizeof(char)*buflen, "gdb /proc/%d/exe %d",
os::current_process_id(), os::current_process_id());
os::fork_and_exec(buf);
yes = false;
}
< prev index next >