< prev index next >

src/os/linux/vm/os_linux.cpp

Print this page
rev 10979 : 8140594: Various minor code improvements (compiler)

*** 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);
*** 5997,6007 **** 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; } --- 5998,6008 ---- 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 >